initial commit
41
README.md
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Treasure Hunting
|
||||
|
||||
Treasure Hunting is supposed to be a small game.
|
||||
Originally it was played in school by a few bored teenagers, with pen and paper - but we want to bring it on screen!
|
||||
This is actually the 5th edition of Treasure Hunting, but the second to be realized digitally.
|
||||
A new version was started, because this one will be in python2.
|
||||
It is not yet decided, which engine will be used.
|
||||
|
||||
# About
|
||||
|
||||
In the world of Treasure Hunting, vampires, werewolves, angels, and several other supernatural entities (SUPs) were living among humans undetected.
|
||||
Since their detection through a recommended scientist with peaceful intentions, their status is complicated.
|
||||
Racist groups are afraid of them and convinced most states to hunt SUPs down and kill them all.
|
||||
But that is not the fate of most SUPs - usually they are used by corporations and other militant groups as effective mercenaries or for research purposes.
|
||||
You are playing one of these soldiers, and are deciding their fate in a world full of corporate interests, racist hostilities and violence.
|
||||
|
||||
# Contents
|
||||
|
||||
This is a new approach, so not all old data and mechanics are used. For these, visit https://github.com/compl4xx/TreasureHunting
|
||||
There is this data:
|
||||
|
||||
notes: these are text files which explain the game and define some of its core mechanics and game data.
|
||||
- Notizen.txt: Game mechanics, to do list, function flow stuff.
|
||||
- Magic.txt: Concept of the magic language.
|
||||
code: here is the folder for the .py files.
|
||||
- \_\_init.py\_\_: empty but important file.
|
||||
- game.py: main code file. here is the game flow.
|
||||
- items.py: file for the item object data.
|
||||
- enemies.py: file for the enemy object data.
|
||||
- augmentations.py: file for the augmentation functions.
|
||||
- editor.py: program to create missions, items, enemies.
|
||||
images: here are all of the game graphics.
|
||||
- characters: graphics of humanoid characters
|
||||
- fields: graphics of surroundings
|
||||
- guns, swords: item graphics
|
||||
- panels: old panel graphics (750x300 window
|
||||
- panels2: current panel graphics (800x600 window)
|
||||
- races: race logos
|
||||
missions: mission files
|
||||
saves: save files
|
||||
resources: here are enemies, guns and swords saved.
|
0
code/__init__.py
Normal file
180
code/augmentations.py
Normal file
|
@ -0,0 +1,180 @@
|
|||
#! /usr/bin/env python
|
||||
# Augmentations
|
||||
# All of them cost 100 BTC?
|
||||
# only 3 of them at the same time
|
||||
# I think there is a dictionary needed to connect the strings to images, and maybe prices.
|
||||
# most augmentation effects are checked in other functions.
|
||||
|
||||
from random import randint
|
||||
|
||||
|
||||
def augment(char, aug, m):
|
||||
""" add an augmentation to character.
|
||||
|
||||
When a Character gets an augmentation, its name is put in the
|
||||
char.augmentations-list. if it has a static effect on char values,
|
||||
they are also changed in this function. every other effects are
|
||||
checked in other functions.
|
||||
:param char: object
|
||||
:param aug: string
|
||||
:param m: SDLInstanceManager object
|
||||
:return: char: object
|
||||
"""
|
||||
if aug in char.augmentations:
|
||||
m.console.push("ERROR: Character already has " + aug + ".")
|
||||
elif len(char.augmentations) > 4:
|
||||
m.console.push("ERROR: Character has already 3 augmentations")
|
||||
else:
|
||||
if "cosmetic surgery" in char.augmentations:
|
||||
cost = 90
|
||||
else:
|
||||
cost = 100
|
||||
if char.bitcoins < cost:
|
||||
m.console.push("ERROR: Not enough bitcoins!")
|
||||
return char
|
||||
else:
|
||||
char.bitcoins -= cost
|
||||
if randint(0, 99) > 10:
|
||||
if aug == "genetic surgery":
|
||||
char.morph = True
|
||||
elif aug == "eye processor":
|
||||
char.agi += 2
|
||||
elif aug == "artificial leg":
|
||||
char.mob += 2
|
||||
char.augmentations.append(aug)
|
||||
m.console.push("The surgery went well.")
|
||||
else:
|
||||
char.con -= 1
|
||||
m.console.push("The surgery failed. You lose 1 Consitution.")
|
||||
m.charwin.process()
|
||||
return char
|
||||
|
||||
|
||||
def deaugment(char, aug, m):
|
||||
""" erase an augmentation from character.
|
||||
|
||||
first destroys values, if they had been changed by augmentation, then
|
||||
deletes name from char.augmentations
|
||||
:param char: object
|
||||
:param aug: string
|
||||
:param m: SDLInstanceManager object
|
||||
:return: char: object
|
||||
"""
|
||||
if aug not in char.augmentations:
|
||||
m.console.push("ERROR: Character doesn't have " + aug + ".")
|
||||
else:
|
||||
if aug == "genetic surgery":
|
||||
char.morph = False
|
||||
elif aug == "eye processor":
|
||||
char.agi -= 2
|
||||
elif aug == "artificial leg":
|
||||
char.mob -= 2
|
||||
char.augmentations.remove(aug) # does this work? aug is not in
|
||||
# augmentations asd
|
||||
if randint(0, 99) > 10:
|
||||
m.console.push(aug + " has been removed successfully.")
|
||||
m.charwin.process()
|
||||
else:
|
||||
char.con -= 1
|
||||
m.console.push("The surgery failed. You lose 1 Consitution.")
|
||||
return char
|
||||
|
||||
|
||||
all_augmentations = {
|
||||
"artificial leg": "../images/augmentations/artificial_leg.gif",
|
||||
"reflex chip": "../images/augmentations/reflex_chip.gif",
|
||||
"kevlar implant": "../images/augmentations/kevlar_implant.gif",
|
||||
"eye processor": "../images/augmentations/eye_processor.gif",
|
||||
"cosmetic surgery": "../images/augmentations/cosmetic_surgery.gif",
|
||||
"fear blocker": "../images/augmentations/fear_blocker.gif",
|
||||
"wallhack": "../images/augmentations/wallhack.gif",
|
||||
"genetic surgery": "../images/augmentations/genetic_surgery.gif",
|
||||
"learning software": "../images/augmentations/learning_software.gif",
|
||||
"blessed by luck": "../images/augmentations/blessed_by_luck.gif"
|
||||
}
|
||||
# What other augmentations are there, and what do they do?
|
||||
'''
|
||||
def artificial_leg(char):
|
||||
# mobility + 2
|
||||
if char.augmentations.length > 4:
|
||||
print("ERROR: already 3 augmentations")
|
||||
else:
|
||||
char.augmentations.append("artificial leg")
|
||||
char.mob += 2
|
||||
|
||||
|
||||
def reflex_chip(char):
|
||||
# 10 % Chance each turn, that IC is reduced by 10, checked at turn function
|
||||
if char.augmentations.length > 4:
|
||||
print("ERROR: already 3 augmentations")
|
||||
else:
|
||||
char.augmentations.append("reflex chip")
|
||||
|
||||
|
||||
def kevlar_implant(char):
|
||||
# +20 max_HP, check at update_maxHP()
|
||||
if char.augmentations.length > 4:
|
||||
print("ERROR: already 3 augmentations")
|
||||
else:
|
||||
char.augmentations.append("kevlar implant")
|
||||
|
||||
|
||||
def eye_processor(char):
|
||||
# agility + 2
|
||||
if char.augmentations.length > 4:
|
||||
print("ERROR: already 3 augmentations")
|
||||
else:
|
||||
char.augmentations.append("eye processor")
|
||||
char.agi += 2
|
||||
|
||||
|
||||
def cosmetic_surgery(char):
|
||||
# all costs -10 BTC, checked at buy function
|
||||
if char.augmentations.length > 4:
|
||||
print("ERROR: already 3 augmentations")
|
||||
else:
|
||||
char.augmentations.append("cosmetic surgery")
|
||||
|
||||
|
||||
def fear_blocker(char):
|
||||
# Use guns in melee, checked at act function
|
||||
if char.augmentations.length > 4:
|
||||
print("ERROR: already 3 augmentations")
|
||||
else:
|
||||
char.augmentations.append("fear blocker")
|
||||
|
||||
|
||||
def wallhack(char):
|
||||
# No hitting malus because of barricades
|
||||
if char.augmentations.length > 4:
|
||||
print("ERROR: already 3 augmentations")
|
||||
else:
|
||||
char.augmentations.append("wallhack")
|
||||
|
||||
|
||||
def genetic_surgery(char):
|
||||
# Player can morph into a werewolf: double stats, dont use weapons while morphed
|
||||
if char.augmentations.length > 4:
|
||||
print("ERROR: already 3 augmentations")
|
||||
elif char.morph:
|
||||
print("ERROR: player can already turn into a werewolf")
|
||||
else:
|
||||
char.augmentations.append("genetic surgery")
|
||||
char.morph = True
|
||||
|
||||
|
||||
def learning_software(char):
|
||||
# needed XP per level: -15, checked at levelup function
|
||||
if char.augmentations.length > 4:
|
||||
print("ERROR: already 3 augmentations")
|
||||
else:
|
||||
char.augmentations.append("learning software")
|
||||
|
||||
|
||||
def blessed_by_luck(char):
|
||||
# chance tests += 0.05, checked at chance function?
|
||||
if char.augmentations.length > 4:
|
||||
print("ERROR: already 3 augmentations")
|
||||
else:
|
||||
char.augmentations.append("blessed by luck")
|
||||
'''
|
858
code/editor.py
Normal file
|
@ -0,0 +1,858 @@
|
|||
#! /usr/bin/env python
|
||||
# coding=utf-8
|
||||
#
|
||||
#
|
||||
# contents:
|
||||
# 1. Imports
|
||||
# 2. Globals
|
||||
# 3. Classes
|
||||
# 4.
|
||||
|
||||
|
||||
|
||||
# # # # # # #
|
||||
# 1.Imports #
|
||||
# # # # # # #
|
||||
import pickle
|
||||
import pygtk
|
||||
import game
|
||||
import os
|
||||
from enemies import *
|
||||
from items import *
|
||||
pygtk.require("2.0")
|
||||
import gtk
|
||||
|
||||
|
||||
# # # # # # #
|
||||
# 2.Globals #
|
||||
# # # # # # #
|
||||
|
||||
|
||||
|
||||
|
||||
# # # # # # #
|
||||
# 3.Classes #
|
||||
# # # # # # #
|
||||
|
||||
|
||||
|
||||
class RoomEditor(object):
|
||||
""" Room Editor window class.
|
||||
|
||||
Window contains a List of choosable fields on the right, the modifiable fields on the left,
|
||||
and can give certain fields other values, which go into Room.fielddata
|
||||
or it does when its ready >.<
|
||||
weird bug: Save&Quit doesnt close the window, but still returns a room object.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.chosen = "W"
|
||||
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||
self.window.connect("delete_event", self.delete_event)
|
||||
self.window.connect("destroy", self.destroy)
|
||||
self.window.set_border_width(10)
|
||||
|
||||
self.box2 = gtk.HBox(False, 0)
|
||||
self.menubox = gtk.VBox(False, 0)
|
||||
|
||||
# initialise list of lists: fields, later argument to Room()
|
||||
self.fields = []
|
||||
for i in range(30):
|
||||
self.fields.append([])
|
||||
for j in range(52):
|
||||
self.fields[i].append("O")
|
||||
# initialize dictionary: fielddata, later argument to Room()
|
||||
self.fielddata = {}
|
||||
self.show_fields()
|
||||
|
||||
# List which contains the buttons to choose field types
|
||||
self.choose_buttons = []
|
||||
self.choose_buttons.append(self.add_button(i_wall(), self.choose_field,
|
||||
box=self.menubox, arg="W"))
|
||||
self.choose_buttons.append(self.add_button(i_leer(), self.choose_field,
|
||||
box=self.menubox, arg="O"))
|
||||
self.choose_buttons.append(self.add_button(i_barricada(), self.choose_field,
|
||||
box=self.menubox, arg="B"))
|
||||
self.choose_buttons.append(self.add_button(i_treasure(), self.choose_field,
|
||||
box=self.menubox, arg="T"))
|
||||
self.choose_buttons.append(self.add_button(i_player(), self.choose_field,
|
||||
box=self.menubox, arg=0))
|
||||
self.choose_buttons.append(self.add_button(i_1one(), self.choose_field,
|
||||
box=self.menubox, arg=1))
|
||||
self.choose_buttons.append(self.add_text_button("Give Option", self.choose_field,
|
||||
box=self.menubox, arg="C"))
|
||||
self.choose_buttons.append(self.add_text_button("Save & Quit", self.savequit,
|
||||
box=self.menubox))
|
||||
|
||||
self.window.add(self.box2)
|
||||
self.box2.pack_end(self.menubox) # Vertical Box, for choosing Buttons
|
||||
|
||||
self.menubox.show()
|
||||
self.box2.show()
|
||||
self.window.unmaximize()
|
||||
self.window.show()
|
||||
|
||||
def main(self):
|
||||
gtk.main() # starting event processing loop
|
||||
|
||||
def delete_event(self, widget, event, data=None):
|
||||
"""
|
||||
:return False if you want to destroy window
|
||||
:return True if you want to keep window
|
||||
"""
|
||||
print "[Gtk] delete event occured"
|
||||
return False
|
||||
|
||||
def destroy(self, widget, data=None):
|
||||
gtk.main_quit()
|
||||
|
||||
def add_button(self, image, function, box=0, arg=None):
|
||||
self.button = gtk.Button()
|
||||
# When the button is clicked it calls self.hello()
|
||||
self.button.connect("clicked", function, arg)
|
||||
self.button.add(image)
|
||||
# pack a box to the beginning.
|
||||
if box:
|
||||
box.pack_start(self.button, True, True, 0)
|
||||
# Close the window
|
||||
# uncomment this if you want to close all parent windows without other children
|
||||
# when you close a window.
|
||||
# self.button1.connect_object("clicked", gtk.Widget.destroy, self.window)
|
||||
self.button.show()
|
||||
return self.button
|
||||
|
||||
def add_text_button(self, label, function, box=0, arg=None):
|
||||
self.button = gtk.Button(label)
|
||||
self.button.connect("clicked", function, arg)
|
||||
if box:
|
||||
box.pack_start(self.button, True, True, 0)
|
||||
self.button.show()
|
||||
return self.button
|
||||
|
||||
def choose_field(self, unusedbutnecessary, arg):
|
||||
""" choose, which field you want to add to Room.fields
|
||||
|
||||
:param arg: string/integer of field type which is chosen to be added to fields.
|
||||
"""
|
||||
self.chosen = arg
|
||||
|
||||
def show_fields(self):
|
||||
""" shows the current fields.
|
||||
|
||||
:param fields: list of lists
|
||||
:return:
|
||||
"""
|
||||
y = len(self.fields)
|
||||
x = len(self.fields[0])
|
||||
self.table = gtk.Table(x, y)
|
||||
self.buttonlist = []
|
||||
for i in range(y):
|
||||
self.buttonlist.append([])
|
||||
for j in range(x):
|
||||
a = (i, j)
|
||||
a = self.add_button(self.which_image(self.fields[i][j]),
|
||||
self.change_field, arg=a)
|
||||
self.buttonlist[i].append(a)
|
||||
self.table.attach(a, j, j + 1, i, i + 1)
|
||||
a.show()
|
||||
self.box2.pack_start(self.table)
|
||||
self.table.show()
|
||||
|
||||
def change_field(self, unusedbutnecessary, xy):
|
||||
if self.chosen == "C":
|
||||
self.give_option()
|
||||
return
|
||||
i = xy[0]
|
||||
j = xy[1]
|
||||
self.fields[i][j] = self.chosen
|
||||
self.buttonlist[i][j].destroy()
|
||||
a = self.add_button(self.which_image(self.fields[i][j]), self.change_field, arg=xy)
|
||||
self.buttonlist[i][j] = a
|
||||
self.table.attach(a, j, j + 1, i, i + 1)
|
||||
a.show()
|
||||
self.table.show()
|
||||
self.box2.show()
|
||||
self.window.show()
|
||||
|
||||
def which_image(self, arg):
|
||||
if arg == "W":
|
||||
return i_wall()
|
||||
elif arg == "O":
|
||||
return i_leer()
|
||||
elif arg == "B":
|
||||
return i_barricada()
|
||||
elif arg == "T":
|
||||
return i_treasure()
|
||||
elif arg == 0:
|
||||
return i_player()
|
||||
elif arg == 1:
|
||||
return i_1one()
|
||||
|
||||
def give_option(self, unusedbutnecessary, xy):
|
||||
""" Dialog to add entries to fielddata.
|
||||
|
||||
This is executed if the give_option is chosen and a field is clicked.
|
||||
The field type is then assigned a value, e.g:
|
||||
{
|
||||
1 : "Police Officer", (enemy[0])
|
||||
2 : 15413874260947 (Room.description)
|
||||
}
|
||||
for now I can't implement Doors, as there is no way to edit Rooms.
|
||||
enemies: list of lists
|
||||
Do I need this function? maybe I should do this with CLI.
|
||||
:param unusedbutnecessary: unused
|
||||
:param xy: tuple(x,y), self.fields[x][y]
|
||||
:return:
|
||||
"""
|
||||
# dialog
|
||||
# Lots of Buttons to choose from:
|
||||
# for room in rooms: room.id
|
||||
# for enemy in enemies: enemy[0]
|
||||
# fielddata.remove(entry)
|
||||
# fielddata[entry] = choice
|
||||
# dialog = gtk.Dialog(title="Enter a description", parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, buttons=None)
|
||||
with open("../resources/enemies", "r+") as file:
|
||||
enemies = pickle.load(file)
|
||||
|
||||
def savequit(self, unusedbutnecessary, unusedbutnecessary2):
|
||||
dialog = gtk.Dialog(title="Enter a description", parent=self.window,
|
||||
flags=gtk.DIALOG_DESTROY_WITH_PARENT, buttons=None)
|
||||
entry = gtk.Entry()
|
||||
dialog.action_area.pack_start(entry)
|
||||
entry.show()
|
||||
|
||||
button = gtk.Button("Ok")
|
||||
button.connect("clicked", self.getext, entry)
|
||||
button.connect("clicked", dialog.destroy)
|
||||
dialog.action_area.pack_start(button)
|
||||
button.show()
|
||||
|
||||
dialog.action_area.show()
|
||||
dialog.show()
|
||||
|
||||
def getext(self, unusedbutnecessary, widget):
|
||||
description = widget.get_text()
|
||||
widget.destroy()
|
||||
self.room = game.Room(self.fields, self.fielddata, description)
|
||||
self.window.destroy()
|
||||
|
||||
|
||||
class Choose_Field_Window(object):
|
||||
""" Window for choosing one field of the mission.
|
||||
|
||||
weird bug: Save&Quit doesnt close the window, but still returns the coordinates.
|
||||
"""
|
||||
def __init__(self, room):
|
||||
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||
self.window.connect("delete_event", self.delete_event)
|
||||
self.window.connect("destroy", self.destroy)
|
||||
self.window.set_border_width(10)
|
||||
self.box1 = gtk.HBox()
|
||||
self.room = room
|
||||
self.show_fields()
|
||||
self.window.add(self.box1)
|
||||
self.box1.show()
|
||||
self.window.show()
|
||||
|
||||
def main(self):
|
||||
gtk.main() # starting event processing loop
|
||||
return self.arg
|
||||
|
||||
def delete_event(self, widget, event, data=None):
|
||||
"""
|
||||
:return False if you want to destroy window
|
||||
:return True if you want to keep window
|
||||
"""
|
||||
print "[Gtk] delete event occured"
|
||||
return False
|
||||
|
||||
def destroy(self, widget, data=None):
|
||||
gtk.main_quit()
|
||||
|
||||
def show_fields(self):
|
||||
""" shows the current fields.
|
||||
|
||||
:param fields: list of lists
|
||||
:return:
|
||||
"""
|
||||
y = len(self.room.fields)
|
||||
x = len(self.room.fields[0])
|
||||
self.table = gtk.Table(x, y)
|
||||
self.buttonlist = []
|
||||
for i in range(y):
|
||||
self.buttonlist.append([])
|
||||
for j in range(x):
|
||||
a = (i, j)
|
||||
a = self.add_button(self.which_image(self.room.fields[i][j]), self.choose_field, arg=a)
|
||||
self.buttonlist[i].append(a)
|
||||
self.table.attach(a, j, j + 1, i, i + 1)
|
||||
a.show()
|
||||
self.box1.pack_start(self.table)
|
||||
self.table.show()
|
||||
|
||||
def which_image(self, arg):
|
||||
if arg == "W":
|
||||
return i_wall()
|
||||
elif arg == "O":
|
||||
return i_leer()
|
||||
elif arg == "B":
|
||||
return i_barricada()
|
||||
elif arg == "T":
|
||||
return i_treasure()
|
||||
elif arg == 0:
|
||||
return i_player()
|
||||
elif arg == 1:
|
||||
return i_1one()
|
||||
|
||||
def add_button(self, image, function, box=0, arg=None):
|
||||
self.button = gtk.Button()
|
||||
self.button.add(image)
|
||||
# When the button is clicked it calls self.hello()
|
||||
self.button.connect("clicked", function, arg)
|
||||
# pack a box to the beginning.
|
||||
if box:
|
||||
box.pack_start(self.button, True, True, 0)
|
||||
# Close the window
|
||||
# uncomment this if you want to close all parent windows without other children
|
||||
# when you close a window.
|
||||
# self.button1.connect_object("clicked", gtk.Widget.destroy, self.window)
|
||||
self.button.show()
|
||||
return self.button
|
||||
|
||||
def choose_field(self, unusedbutnecessary, arg):
|
||||
self.arg = arg
|
||||
self.window.destroy()
|
||||
|
||||
|
||||
class CreateEnemyWin(object):
|
||||
def __init__(self):
|
||||
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||
self.window.connect("delete_event", self.delete_event)
|
||||
self.window.connect("destroy", self.destroy)
|
||||
self.window.set_border_width(20)
|
||||
global filename
|
||||
filename = "../images/1one.gif" # default value
|
||||
|
||||
self.box1 = gtk.VBox()
|
||||
self.table1()
|
||||
|
||||
self.button = gtk.Button("Done")
|
||||
self.button.connect("clicked", self.get_values)
|
||||
self.button.connect("clicked", self.destroy)
|
||||
self.box1.pack_start(self.button)
|
||||
self.button.show()
|
||||
|
||||
self.window.add(self.box1)
|
||||
self.box1.show()
|
||||
self.window.show()
|
||||
|
||||
def main(self):
|
||||
gtk.main() # starting event processing loop
|
||||
return self.output
|
||||
|
||||
def delete_event(self, widget, event, data=None):
|
||||
"""
|
||||
:return False if you want to destroy window
|
||||
:return True if you want to keep window
|
||||
"""
|
||||
print "[Gtk] delete event occured"
|
||||
return False
|
||||
|
||||
def destroy(self, widget, data=None):
|
||||
gtk.main_quit()
|
||||
|
||||
def table1(self):
|
||||
self.table = gtk.Table(2, 13)
|
||||
self.tablelabel("Name:", 0)
|
||||
self.tablelabel("Race:", 1)
|
||||
self.tablelabel("Image:", 2)
|
||||
self.tablelabel("Constitution:", 3)
|
||||
self.tablelabel("Strength:", 4)
|
||||
self.tablelabel("Agility:", 5)
|
||||
self.tablelabel("Mobility:", 6)
|
||||
self.tablelabel("Intelligence:", 7)
|
||||
self.tablelabel("Gun:", 8)
|
||||
self.tablelabel("Sword:", 9)
|
||||
self.tablelabel("Min. Loot:", 10)
|
||||
self.tablelabel("Max. Loot:", 11)
|
||||
self.tablelabel("Experience", 12)
|
||||
self.inputs = []
|
||||
self.tableobject(gtk.Entry, 0)
|
||||
self.tableobject(gtk.Entry, 1)
|
||||
|
||||
self.button = gtk.Button("Choose File")
|
||||
self.button.connect("clicked", self.choose_file)
|
||||
self.table.attach(self.button, 1, 2, 2, 3)
|
||||
self.button.show()
|
||||
|
||||
self.tableobject(gtk.Entry, 3)
|
||||
self.tableobject(gtk.Entry, 4)
|
||||
self.tableobject(gtk.Entry, 5)
|
||||
self.tableobject(gtk.Entry, 6)
|
||||
self.tableobject(gtk.Entry, 7)
|
||||
self.tableobject(gtk.Entry, 8)
|
||||
self.tableobject(gtk.Entry, 9)
|
||||
self.tableobject(gtk.Entry, 10)
|
||||
self.tableobject(gtk.Entry, 11)
|
||||
self.tableobject(gtk.Entry, 12)
|
||||
|
||||
self.box1.pack_start(self.table)
|
||||
self.table.show()
|
||||
|
||||
def tablelabel(self, title, y):
|
||||
a = gtk.Label(title)
|
||||
self.table.attach(a, 0, 1, y, y + 1)
|
||||
a.show()
|
||||
|
||||
def tableobject(self, Klass, y):
|
||||
a = Klass()
|
||||
self.inputs.append(a)
|
||||
self.table.attach(a, 1, 2, y, y + 1)
|
||||
a.show()
|
||||
|
||||
def get_values(self, unusedbutnecessary):
|
||||
lst = []
|
||||
end = []
|
||||
for a in self.inputs:
|
||||
lst.append(a.get_text())
|
||||
for i in range(len(lst) + 1):
|
||||
if i == 2:
|
||||
end.append(self.filename)
|
||||
end.append(i)
|
||||
self.output = {lst[0]: lst}
|
||||
|
||||
def choose_file(self, unusedbutnecessary):
|
||||
self.filesel = gtk.FileSelection("Select an image")
|
||||
self.filesel.ok_button.connect("clicked", lambda w: self.file_ok_sel)
|
||||
self.filesel.ok_button.connect("clicked", lambda w: self.filesel.destroy())
|
||||
self.filesel.cancel_button.connect("clicked", lambda w: self.filesel.destroy())
|
||||
self.filesel.set_filename("../images/characters/1one.gif")
|
||||
self.filesel.show()
|
||||
|
||||
def file_ok_sel(self, w):
|
||||
global filename
|
||||
filename = self.filesel.get_filename()
|
||||
|
||||
|
||||
class CreateGunWin(object):
|
||||
""" Window to create guns classes.
|
||||
|
||||
To do: design gun logos and change the default values.
|
||||
|
||||
def __init__(self, name, price, image, damage, grange, ap):
|
||||
super(Gun, self).__init__(name, price, image)
|
||||
self.damage = damage # Integer
|
||||
self.grange = grange # Integer
|
||||
self.ap = ap # Integer, AP needed to fire the gun
|
||||
self.type = "gun"
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||
self.window.connect("delete_event", self.delete_event)
|
||||
self.window.connect("destroy", self.destroy)
|
||||
self.window.set_border_width(20)
|
||||
self.filename = "../images/guns/glock.gif" # default value
|
||||
|
||||
self.box1 = gtk.VBox()
|
||||
self.table1()
|
||||
|
||||
self.button = gtk.Button("Done")
|
||||
self.button.connect("clicked", self.get_values)
|
||||
self.button.connect("clicked", self.destroy)
|
||||
self.box1.pack_start(self.button)
|
||||
self.button.show()
|
||||
|
||||
self.window.add(self.box1)
|
||||
self.box1.show()
|
||||
self.window.show()
|
||||
|
||||
def main(self):
|
||||
gtk.main() # starting event processing loop
|
||||
return self.output
|
||||
|
||||
def delete_event(self, widget, event, data=None):
|
||||
"""
|
||||
:return False if you want to destroy window
|
||||
:return True if you want to keep window
|
||||
"""
|
||||
print "[Gtk] delete event occured"
|
||||
return False
|
||||
|
||||
def destroy(self, widget, data=None):
|
||||
gtk.main_quit()
|
||||
|
||||
def table1(self):
|
||||
self.table = gtk.Table(2, 13)
|
||||
self.tablelabel("Name:", 0)
|
||||
self.tablelabel("Price:", 1)
|
||||
self.tablelabel("Damage:", 2)
|
||||
self.tablelabel("Range:", 3)
|
||||
self.tablelabel("AP:", 4)
|
||||
self.tablelabel("Image:", 5)
|
||||
self.inputs = []
|
||||
for i in range(0, 5):
|
||||
self.tableobject(gtk.Entry, i)
|
||||
|
||||
self.button = gtk.Button("Choose File")
|
||||
self.button.connect("clicked", self.choose_file)
|
||||
self.table.attach(self.button, 1, 2, 5, 6)
|
||||
self.button.show()
|
||||
|
||||
self.box1.pack_start(self.table)
|
||||
self.table.show()
|
||||
|
||||
def tablelabel(self, title, y):
|
||||
a = gtk.Label(title)
|
||||
self.table.attach(a, 0, 1, y, y + 1)
|
||||
a.show()
|
||||
|
||||
def tableobject(self, Klass, y):
|
||||
a = Klass()
|
||||
self.inputs.append(a)
|
||||
self.table.attach(a, 1, 2, y, y + 1)
|
||||
a.show()
|
||||
|
||||
def get_values(self, unusedbutnecessary):
|
||||
lst = []
|
||||
end = []
|
||||
for a in self.inputs:
|
||||
lst.append(a.get_text())
|
||||
for i in range(len(lst) + 1):
|
||||
if i == 2:
|
||||
end.append(self.filename)
|
||||
end.append(i)
|
||||
self.output = {lst[0]: lst}
|
||||
|
||||
def choose_file(self, unusedbutnecessary):
|
||||
self.filesel = gtk.FileSelection("Select an image")
|
||||
self.filesel.ok_button.connect("clicked", lambda w: self.file_ok_sel)
|
||||
self.filesel.ok_button.connect("clicked", lambda w: self.filesel.destroy())
|
||||
self.filesel.cancel_button.connect("clicked", lambda w: self.filesel.destroy())
|
||||
self.filesel.set_filename("../images/guns/glock.gif")
|
||||
self.filesel.show()
|
||||
|
||||
def file_ok_sel(self, w):
|
||||
global filename
|
||||
filename = self.filesel.get_filename()
|
||||
|
||||
|
||||
# # # # # # # #
|
||||
# 3.Functions #
|
||||
# # # # # # # #
|
||||
|
||||
def i_wall():
|
||||
i_wall = gtk.Image()
|
||||
i_wall.set_from_file("../images/fields/wall.gif")
|
||||
i_wall.show()
|
||||
return i_wall
|
||||
|
||||
|
||||
def i_leer():
|
||||
i_leer = gtk.Image()
|
||||
i_leer.set_from_file("../images/fields/0leer.gif")
|
||||
i_leer.show()
|
||||
return i_leer
|
||||
|
||||
|
||||
def i_barricada():
|
||||
i_barricada = gtk.Image()
|
||||
i_barricada.set_from_file("../images/fields/barricada.gif")
|
||||
i_barricada.show()
|
||||
return i_barricada
|
||||
|
||||
|
||||
def i_treasure():
|
||||
i_treasure = gtk.Image()
|
||||
i_treasure.set_from_file("../images/fields/treasure.gif")
|
||||
i_treasure.show()
|
||||
return i_treasure
|
||||
|
||||
|
||||
def i_player():
|
||||
i_player = gtk.Image()
|
||||
i_player.set_from_file("../images/characters/player.gif")
|
||||
i_player.show()
|
||||
return i_player
|
||||
|
||||
|
||||
def i_1one():
|
||||
i_1one = gtk.Image()
|
||||
i_1one.set_from_file("../images/characters/1one.gif")
|
||||
i_1one.show()
|
||||
return i_1one
|
||||
|
||||
|
||||
def i_circle():
|
||||
i_circle = gtk.Image()
|
||||
i_circle.set_from_file("../images/kreis.gif")
|
||||
i_circle.show()
|
||||
return i_circle
|
||||
|
||||
|
||||
def create_file(filename):
|
||||
""" tests if file exists - if not it creates an empty dict in it.
|
||||
|
||||
:param filename: string - file path to create
|
||||
"""
|
||||
try:
|
||||
with open(filename, "rb"):
|
||||
return
|
||||
except IOError:
|
||||
print("ERROR: ", filename, " doesn't exist, is created instead.")
|
||||
with open(filename, "wb") as file:
|
||||
dct = {}
|
||||
pickle.dump(dct, file)
|
||||
|
||||
|
||||
def create_enemy():
|
||||
""" creating enemy classes and saving them in resources/enemies """
|
||||
print("Create an enemy.")
|
||||
window = CreateEnemyWin()
|
||||
newdict = window.main()
|
||||
print("Saving enemy in resources/enemies...")
|
||||
create_file("../resources/enemies")
|
||||
with open("../resources/enemies", "rb") as file:
|
||||
allenemies = pickle.load(file)
|
||||
for i in newdict:
|
||||
allenemies[i] = newdict[i]
|
||||
with open("../resources/enemies", "wb") as file:
|
||||
pickle.dump(allenemies, file)
|
||||
print("Enemy saved.")
|
||||
|
||||
|
||||
def create_gun():
|
||||
""" creating gun classes and saving them in resources/guns """
|
||||
print("Create a gun.")
|
||||
window = CreateGunWin()
|
||||
newdict = window.main()
|
||||
print("Saving gun in resources/guns...")
|
||||
create_file("../resources/guns")
|
||||
with open("../resources/guns", "rb") as file:
|
||||
allenemies = pickle.load(file)
|
||||
for i in newdict:
|
||||
allenemies[i] = newdict[i]
|
||||
with open("../resources/guns", "wb") as file:
|
||||
pickle.dump(allenemies, file)
|
||||
print("Gun saved.")
|
||||
|
||||
|
||||
def create_fielddata_entry(room):
|
||||
""" Create a fielddata entry for a room
|
||||
|
||||
|
||||
:param room: Room object
|
||||
:return: room: Room object
|
||||
"""
|
||||
choice = 0
|
||||
while choice == 0:
|
||||
print("0 : Abort")
|
||||
for entry in room.fielddata:
|
||||
print(str(entry) + " : " + room.fielddata[entry])
|
||||
try:
|
||||
choice = int(raw_input("Which entry do you want to create? Pick a number which "
|
||||
"is not given yet. delete it if you want to update an "
|
||||
"existing: "))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
if choice == 0:
|
||||
return room
|
||||
elif choice in room.fielddata:
|
||||
print("ERROR: " + str(choice) + " is already in fielddata. Try again.")
|
||||
choice = 0
|
||||
else:
|
||||
room.fielddata[choice] = raw_input("Enter the content of " + str(choice) + ": ")
|
||||
return room
|
||||
|
||||
|
||||
def erase_fielddata_entry(room):
|
||||
"""
|
||||
:param room: Room object
|
||||
:return: room: Room object
|
||||
"""
|
||||
choice = 0
|
||||
while choice == 0:
|
||||
print("0 : Abort")
|
||||
for entry in room.fielddata:
|
||||
print(str(entry) + " : " + room.fielddata[entry])
|
||||
try:
|
||||
choice = int(raw_input("Which entry do you want to delete? "))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
if choice == 0:
|
||||
return room
|
||||
elif choice in room.fielddata:
|
||||
del room.fielddata[choice]
|
||||
return room
|
||||
else:
|
||||
print("ERROR: " + str(choice) + " is not in fielddata. Try again.")
|
||||
choice = 0
|
||||
|
||||
|
||||
def choose_target_enemy(room):
|
||||
for i in room.fielddata:
|
||||
print i, room.fielddata[i]
|
||||
choice = 0
|
||||
while choice == 0:
|
||||
try:
|
||||
choice = int(raw_input("Which enemy is to be killed? "))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
choice = 0
|
||||
room.fielddata["target"] = choice
|
||||
|
||||
|
||||
def create_room():
|
||||
window = RoomEditor()
|
||||
window.main()
|
||||
choice = 0
|
||||
while choice == 0:
|
||||
print("(1) Create a fielddata entry")
|
||||
print("(2) Erase a fielddata entry")
|
||||
print("(3) Choose a target enemy")
|
||||
print("(4) Finish room creation")
|
||||
try:
|
||||
choice = int(raw_input("What do you want to do? "))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
if choice == 1:
|
||||
create_fielddata_entry(window.room)
|
||||
elif choice == 2:
|
||||
erase_fielddata_entry(window.room)
|
||||
elif choice == 3:
|
||||
choose_target_enemy(window.room)
|
||||
elif choice == 4:
|
||||
print("Back to mission creation.")
|
||||
return window.room
|
||||
else:
|
||||
print("ERROR: Enter a number between 1 and 5.")
|
||||
choice = 0
|
||||
|
||||
|
||||
def choose_room(rooms, string):
|
||||
choice = "y"
|
||||
while choice == "y":
|
||||
for i in rooms:
|
||||
print str(id(i)), i.description
|
||||
try:
|
||||
choice = raw_input(string)
|
||||
except ValueError:
|
||||
print("ERROR: Enter the ID of the room.")
|
||||
for i in rooms:
|
||||
try:
|
||||
if id(i) == int(choice):
|
||||
return i
|
||||
except ValueError:
|
||||
if i.description == choice:
|
||||
return i
|
||||
print("ERROR: ID is not in room list.")
|
||||
choice = "y"
|
||||
|
||||
|
||||
def create_mission():
|
||||
""" mission creation func
|
||||
|
||||
rewardmoney # integer
|
||||
rewarditems # list of Item-objects
|
||||
rewardxp # integer
|
||||
description # string
|
||||
room # Room-object where to start
|
||||
target_item # string (name of item) - default: None
|
||||
target_enemy # integer (how many enemies have target attribute) - default: 0
|
||||
target_coordinates # list (x,y,roomID) - default: None
|
||||
"""
|
||||
name = 0
|
||||
while name == 0:
|
||||
name = raw_input("What shall be the name of the mission? ")
|
||||
if name in os.listdir("../missions"):
|
||||
print("ERROR: Mission name already taken.")
|
||||
name = 0
|
||||
rooms = []
|
||||
choice = "y"
|
||||
while choice == "y":
|
||||
print("Create a room.")
|
||||
rooms.append(create_room())
|
||||
try:
|
||||
choice = raw_input("Do you want to create another room? (y/N) ")
|
||||
except ValueError:
|
||||
print("ERROR: Wrong input. Continuing mission creation.")
|
||||
choice = "N"
|
||||
room = choose_room(rooms, "Which room shall be the starting point? ")
|
||||
print("Define success conditions:")
|
||||
target_item = raw_input("Name of target item necessary to win the mission (leave "
|
||||
"empty if not): ")
|
||||
if target_item == "":
|
||||
target_item = None
|
||||
choice = raw_input("Do you want to define target coordinates? (y/N) ")
|
||||
while choice == "y":
|
||||
targetroom = choose_room(rooms, "Which room shall the target position be in? ")
|
||||
field_choice_win = Choose_Field_Window(targetroom)
|
||||
xy = field_choice_win.main()
|
||||
target_coordinates = [xy[0], xy[1], targetroom]
|
||||
choice = raw_input("Do you want to create another target position? (y/N) ")
|
||||
else:
|
||||
target_coordinates = None
|
||||
target_enemy = 0
|
||||
for r in rooms:
|
||||
if "target" in r.fielddata:
|
||||
for i in r.fields:
|
||||
for j in i:
|
||||
if r.fielddata["target"] == j:
|
||||
target_enemy += 1
|
||||
print(str(target_enemy) + " target enemies in mission.")
|
||||
print("Enter additional data: ")
|
||||
money = -1
|
||||
while money == -1:
|
||||
try:
|
||||
money = int(raw_input("How much BTC shall be the reward? "))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
money = -1
|
||||
xp = -1
|
||||
while xp == -1:
|
||||
try:
|
||||
xp = int(raw_input("How much XP shall be rewarded? "))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
xp = -1
|
||||
items = [] # Add reward items as soon as there is a modular item system.
|
||||
print("Enter a mission description:")
|
||||
description = raw_input()
|
||||
mission = game.Mission(money, items, xp, description, room, rooms, target_item,
|
||||
target_enemy, target_coordinates)
|
||||
print("Mission created. Saving mission as missions/" + name + "...")
|
||||
with open("../missions/" + name, mode="wb") as file:
|
||||
pickle.dump(mission, file)
|
||||
print("Mission saved.")
|
||||
|
||||
|
||||
def main():
|
||||
choice = 0
|
||||
while choice == 0:
|
||||
print("(1) Create a mission\n(2) Create a room (useless)\n(3) Create a gun")
|
||||
print("(4) Create a sword\n(5) Create an enemy\n(6) Exit the editor")
|
||||
try:
|
||||
choice = int(raw_input("What do you want to do? "))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
if choice == 1:
|
||||
create_mission()
|
||||
elif choice == 2:
|
||||
create_room()
|
||||
elif choice == 3:
|
||||
create_gun()
|
||||
elif choice == 4:
|
||||
pass
|
||||
# create_sword()
|
||||
elif choice == 5:
|
||||
create_enemy()
|
||||
elif choice == 6:
|
||||
print("Good Bye.")
|
||||
exit()
|
||||
else:
|
||||
print("ERROR: Enter a number between 1 and 5.")
|
||||
choice = 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
218
code/enemies.py
Normal file
|
@ -0,0 +1,218 @@
|
|||
# coding=utf-8
|
||||
# name, race, cons, strs, agis, mobs, ints, gun, sword, image, bitcoinloot (arguments for randint())
|
||||
|
||||
import items
|
||||
from random import randint
|
||||
|
||||
def getenemyid():
|
||||
""" give a character an unique ID.
|
||||
in build_battlefield(), a foelist is created, in which the character
|
||||
objects are created, whose constructor triggers this function, which
|
||||
gives them an unique ID.
|
||||
:return integer
|
||||
"""
|
||||
global enemyidcounter
|
||||
enemyidcounter += 1
|
||||
return enemyidcounter
|
||||
|
||||
|
||||
# This global var increments every time an enemy gets an ID.
|
||||
enemyidcounter = 0
|
||||
|
||||
|
||||
class Enemy(object):
|
||||
""" enemy superclass. this one could get some useful methods one day. """
|
||||
def __init__(self, name, race, image, con, str, agi, mob, int, gun, sword,
|
||||
loot, experience):
|
||||
self.name = name # string
|
||||
self.race = race # string
|
||||
self.image = image # string: path to image
|
||||
self.con = con # integer
|
||||
self.str = str # integer
|
||||
self.agi = agi # integer
|
||||
self.mob = mob # integer
|
||||
self.int = int # integer
|
||||
allitems = items.AllItems()
|
||||
if gun == "random":
|
||||
self.gun = self.randitem(self.allitems.buyablegunsC)
|
||||
else:
|
||||
self.gun = allitems.buyablegunsC[gun]() # string: items.gun
|
||||
if sword == "random":
|
||||
self.sword = self.randitem(self.allitems.buyableswordsC)
|
||||
else:
|
||||
self.sword = allitems.buyableswordsC[sword] # string: items.sword
|
||||
self.loot = loot # list of 2 arguments for randint()
|
||||
self.experience = experience
|
||||
# integer, how much experience player gets at killing asd
|
||||
self.id = getenemyid()
|
||||
self.max_hp = self.con * 8 + self.str * 5 + 10
|
||||
self.hp = self.max_hp
|
||||
self.ic = 1
|
||||
def showinfo(self):
|
||||
pass # open an infobox with info about the enemy on right-click
|
||||
def walk_ap(self):
|
||||
"""
|
||||
returns, how many AP 1 step is costing
|
||||
:return: integer
|
||||
"""
|
||||
walk_ap = 100 / self.mob
|
||||
return walk_ap
|
||||
|
||||
def randitem(self, dict):
|
||||
lst = []
|
||||
for i in dict:
|
||||
if i is not "random":
|
||||
lst.append(dict[i])
|
||||
number = randint(0, len(lst))
|
||||
return lst[number]
|
||||
|
||||
|
||||
"""
|
||||
class Citizen(Enemy):
|
||||
def __init__(self):
|
||||
super(Citizen, self).__init__("Citizen", "human", "", 3, 3, 3, 3, 4,
|
||||
"None", "None", [5, 15], 0)
|
||||
|
||||
|
||||
class Boss(Enemy):
|
||||
def __init__(self):
|
||||
super(Boss, self).__init__("Boss", "human", "", 7, 6, 6, 7, 4,
|
||||
"random", "random", [40, 70], 9)
|
||||
|
||||
|
||||
class Police(Enemy):
|
||||
def __init__(self):
|
||||
super(Police, self).__init__("Police officer", "human", "", 4, 5, 5,
|
||||
4, 4, "glock", "teli", [5, 10], 5)
|
||||
|
||||
|
||||
class Security(Enemy):
|
||||
def __init__(self):
|
||||
super(Security, self).__init__("Private Security", "human", "", 5, 7,
|
||||
5, 4, 4, "random", "teli", [1, 10], 6)
|
||||
|
||||
|
||||
class Mercenary(Enemy):
|
||||
def __init__(self):
|
||||
super(Mercenary, self).__init__("Mercenary", "human", "", 6, 8, 8, 6,
|
||||
4, "ak74", "knife", [5, 20], 7)
|
||||
|
||||
|
||||
class Soldier(Enemy):
|
||||
def __init__(self):
|
||||
super(Soldier, self).__init__("Soldier", "human", "", 7, 8, 8, 7, 4,
|
||||
"random", "knife", [10, 20], 8)
|
||||
|
||||
|
||||
class Taskforce(Enemy):
|
||||
def __init__(self):
|
||||
super(Taskforce, self).__init__("Task Force", "human", "", 9, 10, 10,
|
||||
9, 7, "random", "random", [10, 5], 10)
|
||||
|
||||
|
||||
class Criminal(Enemy):
|
||||
def __init__(self):
|
||||
super(Criminal, self).__init__("Criminal", "human", "", 5, 6, 7, 7, 6,
|
||||
"random", "random", [1, 15], 6)
|
||||
|
||||
|
||||
class Terrorist(Enemy):
|
||||
def __init__(self):
|
||||
super(Terrorist, self).__init__("Terrorist", "human", "", 5, 7, 9, 8,
|
||||
6, "random", "random", [1, 15], 7)
|
||||
|
||||
|
||||
class Silver1(Enemy):
|
||||
def __init__(self):
|
||||
super(Silver1, self).__init__("Besorgt", "human", "", 4, 5, 5, 4, 2,
|
||||
"random", "silversword",
|
||||
[1, 10], 7)
|
||||
|
||||
|
||||
class Silver2(Enemy):
|
||||
def __init__(self):
|
||||
super(Silver2, self).__init__("Fascist", "human", "", 8, 10, 8, 5, 2,
|
||||
"random", "whip", [10, 20], 11)
|
||||
|
||||
|
||||
class Angel1(Enemy):
|
||||
def __init__(self):
|
||||
super(Angel1, self).__init__("Angel", "angel", "", 5, 3, 8, 7, 6,
|
||||
"random", "random", [10, 15], 8)
|
||||
|
||||
|
||||
class Angel2(Enemy):
|
||||
def __init__(self):
|
||||
super(Angel2, self).__init__("High Angel", "angel", "", 6, 4, 10, 8,
|
||||
7, "random", "random", [15, 25], 12)
|
||||
|
||||
|
||||
class Vampire1(Enemy):
|
||||
def __init__(self):
|
||||
super(Vampire1, self).__init__("Vampire", "vampire", "", 7, 9, 5, 5,
|
||||
6, "random", "random", [10, 15], 8)
|
||||
|
||||
|
||||
class Vampire2(Enemy):
|
||||
def __init__(self):
|
||||
super(Vampire2, self).__init__("Dark Vampire", "vampire", "", 8, 11,
|
||||
6, 6, 7, "random", "random", [15, 25],
|
||||
12)
|
||||
|
||||
|
||||
class Werewolf1(Enemy):
|
||||
def __init__(self):
|
||||
super(Werewolf1, self).__init__("Werewolf", "werewolf", "", 4, 5, 6,
|
||||
5, 5, "random", "krallen", [10, 15], 8)
|
||||
|
||||
|
||||
class Werewolf2(Enemy):
|
||||
def __init__(self):
|
||||
super(Werewolf2, self).__init__("Furious Werewolf ", "werewolf", "",
|
||||
5, 8, 6, 6, 5, "random",
|
||||
"silverkrallen", [15, 25], 12)
|
||||
|
||||
|
||||
# You can create an enemy object by calling: enemies.all_enemies[name]()
|
||||
all_enemies = {
|
||||
"Citizen": Citizen, "Boss": Boss, "Police Officer": Police,
|
||||
"Private Security": Security, "Mercenary": Mercenary, "Soldier": Soldier,
|
||||
"Task Force": Taskforce, "Criminal": Criminal, "Terrorist": Terrorist,
|
||||
"Besorgt": Silver1, "Fascist": Silver2, "Angel": Angel1,
|
||||
"High Angel": Angel2, "Vampire": Vampire1, "Dark Vampire": Vampire2,
|
||||
"Werewolf": Werewolf1, "Furious Werewolf": Werewolf2
|
||||
}
|
||||
|
||||
|
||||
civilian = ["Citizen", "human", "", 0, 0, 0, 0, 0, "None", "None", [5, 15], 0]
|
||||
boss = ["Boss", "human", 7, 6, 6, 7, 0, "random", "random", [40, 70], 9]
|
||||
|
||||
police = ["Police Officer", "human", "", 0, 0, 0, 0, 0, "glock", "teli", [5, 10], 5]
|
||||
security = ["Private Security", "human", "", 1, 2, 0, 0, 0, "random", "teli", [1, 10], 6]
|
||||
mercenary = ["Mercenary", "human", "", 2, 3, 2, 2, 1, "ak74", "knife", [5, 20], 7]
|
||||
soldier = ["Soldier", "human", "", 3, 3, 3, 3, 2, "random", "knife", [10, 20], 8]
|
||||
taskforce = ["Task force", "human", "", 5, 5, 5, 5, 3, "random", "random", [10, 50], 10]
|
||||
|
||||
criminal = ["Criminial", "human", "", 1, 1, 2, 3, 2, "random", "random", [1, 15], 6]
|
||||
terrorist = ["Terrorist", "human", "", 1, 2, 4, 4, 2, "random", "random", [1, 15], 7]
|
||||
|
||||
silver1 = ["Besorgt", "human", "", 0, 0, 0, 0, 0, "random", "silversword", [1, 10], 7]
|
||||
silver2 = ["Fascist", "human", "", 4, 5, 3, 1, 3, "random", "whip", [10, 20], 11]
|
||||
|
||||
angel1 = ["Angel", "angel", "", 1, 0, 1, 0, 1, "random", "random", [10, 15], 8]
|
||||
angel2 = ["Angel", "angel", "", 2, 1, 3, 1, 2, "random", "random", [15, 25], 12]
|
||||
|
||||
vampire1 = ["Vampire", "vampire", "", 1, 1, 0, 0, 1, "random", "random", [10, 15], 8]
|
||||
vampire2 = ["Vampire", "vampire", "", 2, 3, 1, 1, 2, "random", "random", [15, 25], 12]
|
||||
|
||||
werewolf1 = ["Werewolf", "werewolf", "", 0, 0, 1, 1, 1, "random", "krallen", [10, 15], 8]
|
||||
werewolf2 = ["Werewolf", "werewolf", "", 1, 3, 1, 2, 1, "random", "silverkrallen", [15, 25], 12]
|
||||
|
||||
all_enemies = {
|
||||
"Citizen": civilian, "Boss": boss, "Police Officer": police,
|
||||
"Private Security": security, "Mercenary": mercenary, "Soldier": soldier,
|
||||
"Task Force": taskforce, "Criminal": criminal, "Terrorist": terrorist,
|
||||
"Besorgt": silver1, "Fascist": silver2, "Angel": angel1,
|
||||
"High Angel": angel2, "Vampire": vampire1, "Dark Vampire": vampire2,
|
||||
"Werewolf": werewolf1, "Furious Werewolf": werewolf2
|
||||
} """
|
1298
code/game.py
Normal file
304
code/items.py
Normal file
|
@ -0,0 +1,304 @@
|
|||
#! /usr/bin/env python
|
||||
# coding=utf-8
|
||||
|
||||
# from random import randint
|
||||
|
||||
|
||||
# Main Classes
|
||||
|
||||
class Item(object):
|
||||
""" major item class """
|
||||
|
||||
def __init__(self, name, price, image):
|
||||
self.name = name # string: item name
|
||||
self.price = price # integer: price in BTC
|
||||
self.image = image # string containing path to image
|
||||
|
||||
|
||||
class Gun(Item):
|
||||
""" gun subclass """
|
||||
|
||||
def __init__(self, name, price, image, damage, grange, ap):
|
||||
super(Gun, self).__init__(name, price, image)
|
||||
self.damage = damage # Integer
|
||||
self.grange = grange # Integer
|
||||
self.ap = ap # Integer, AP needed to fire the gun
|
||||
self.type = "gun"
|
||||
|
||||
|
||||
class Sword(Item):
|
||||
""" sword subclass """
|
||||
|
||||
def __init__(self, name, price, image, ap, critical, stun, damage,
|
||||
silverdamage):
|
||||
super(Sword, self).__init__(name, price, image)
|
||||
self.damage = damage # integer: damage dealt
|
||||
self.ap = ap # integer: ap needed to attack
|
||||
self.critical = critical # float: chance to do critical damage
|
||||
self.stun = stun # float: change to stun enemy
|
||||
self.silverdamage = silverdamage # boolean: does extra damage to SUPs
|
||||
self.type = "sword"
|
||||
|
||||
|
||||
"""
|
||||
# Swords
|
||||
|
||||
# name
|
||||
# price
|
||||
# path to image (empty string until artwork is done)
|
||||
# AP
|
||||
# Critical ( Damage*2 )
|
||||
# Stun
|
||||
# Damage
|
||||
# Silverdamage ( Damage*2 )
|
||||
|
||||
class Nosword(Sword):
|
||||
def __init__(self):
|
||||
super(Nosword, self).__init__("Fist", 0, "", 50, 0.0, 0.3, 0, False)
|
||||
|
||||
|
||||
class Baton(Sword):
|
||||
def __init__(self):
|
||||
super(Baton, self).__init__("Baton", 20, "", 75, 0.0, 0.3, 20, False)
|
||||
|
||||
|
||||
class Knife(Sword):
|
||||
def __init__(self):
|
||||
super(Knife, self).__init__("Knife", 20, "", 60, 0.2, 0.0, 30, False)
|
||||
|
||||
|
||||
class Shortsword(Sword):
|
||||
def __init__(self):
|
||||
super(Shortsword, self).__init__("Short sword", 40, "", 90, 0.3, 0.0,
|
||||
50, False)
|
||||
|
||||
|
||||
class Longsword(Sword):
|
||||
def __init__(self):
|
||||
super(Longsword, self).__init__("Long sword", 70, "", 120, 0.4, 0.1,
|
||||
70, False)
|
||||
|
||||
|
||||
class NunChaku(Sword):
|
||||
def __init__(self):
|
||||
super(NunChaku, self).__init__("Nun-Chakus", 70, "", 80, 0.1, 0.7, 50,
|
||||
False)
|
||||
|
||||
|
||||
class Mace(Sword):
|
||||
def __init__(self):
|
||||
super(Mace, self).__init__("Mace", 70, "", 100, 0.1, 0.5, 70, False)
|
||||
|
||||
|
||||
class Claymore(Sword):
|
||||
def __init__(self):
|
||||
super(Claymore, self).__init__("Claymore", 120, "", 150, 0.3, 0.2,
|
||||
120, False)
|
||||
|
||||
|
||||
class Katana(Sword):
|
||||
def __init__(self):
|
||||
super(Katana, self).__init__("Katana", 100, "", 110, 0.6, 0.1, 75,
|
||||
False)
|
||||
|
||||
|
||||
class Silversword(Sword):
|
||||
def __init__(self):
|
||||
super(Silversword, self).__init__("Silver sword", 90, "", 120, 0.3,
|
||||
0.2, 50, True)
|
||||
|
||||
|
||||
class Silverdagger(Sword):
|
||||
def __init__(self):
|
||||
super(Silverdagger, self).__init__("Silver dagger", 40, "", 60, 0.2,
|
||||
0.0, 30, True)
|
||||
|
||||
|
||||
class Whip(Sword):
|
||||
def __init__(self):
|
||||
super(Whip, self).__init__("Silver whip", 60, "", 150, 0.7, 0.8, 30,
|
||||
True)
|
||||
|
||||
|
||||
class Claws(Sword):
|
||||
def __init__(self):
|
||||
super(Claws, self).__init__("Claws", 50, "", 50, 0.3, 0.6, 30, False)
|
||||
|
||||
|
||||
class Silverclaws(Sword):
|
||||
def __init__(self):
|
||||
super(Silverclaws, self).__init__("Silver Claws", 150, "", 50, 0.4,
|
||||
0.7, 30, True)
|
||||
|
||||
|
||||
# Guns
|
||||
|
||||
# Name
|
||||
# Cost
|
||||
# Path to image (empty until artworks are done)
|
||||
# Damage
|
||||
# g(un)Range
|
||||
# AP needed to fire gun
|
||||
# max. 2 Upgrades
|
||||
|
||||
|
||||
class Nogun(Gun):
|
||||
def __init__(self):
|
||||
super(Nogun, self).__init__("No gun", 0, "", 0, 0, 0)
|
||||
|
||||
|
||||
class Glock(Gun):
|
||||
def __init__(self):
|
||||
super(Glock, self).__init__("Glock", 30, "", 10, 8, 100)
|
||||
|
||||
|
||||
class Uzi(Gun):
|
||||
def __init__(self):
|
||||
super(Uzi, self).__init__("uzi", 50, "", 10, 6, 50)
|
||||
|
||||
|
||||
class Ak74(Gun):
|
||||
def __init__(self):
|
||||
super(Ak74, self).__init__("Kalaschnikow", 80, "", 30, 10, 100)
|
||||
|
||||
|
||||
class P90(Gun):
|
||||
def __init__(self):
|
||||
super(P90, self).__init__("p90 SMG", 60, "", 15, 8, 75)
|
||||
|
||||
|
||||
class Sawnoffshotgun(Gun):
|
||||
def __init__(self):
|
||||
super(Sawnoffshotgun, self).__init__("Sawn-off shotgun", 30, "", 50,
|
||||
4, 150)
|
||||
|
||||
|
||||
class Shotgun(Gun):
|
||||
def __init__(self):
|
||||
super(Shotgun, self).__init__("Shotgun", 80, "", 70, 6, 150)
|
||||
|
||||
|
||||
class Awp(Gun):
|
||||
def __init__(self):
|
||||
super(Awp, self).__init__("Sniper rifle", 140, "", 90, 15, 175)
|
||||
|
||||
|
||||
class M4(Gun):
|
||||
def __init__(self):
|
||||
super(M4, self).__init__("M4 carbine", 110, "", 25, 12, 75)
|
||||
|
||||
|
||||
class Lmg(Gun):
|
||||
def __init__(self):
|
||||
super(Lmg, self).__init__("Light machine gun", 130, "", 10, 4, 25)
|
||||
|
||||
|
||||
class AllItems:
|
||||
# buyableC(lasses) (!= buyableO(bjects)) This dictionary is needed in buy().
|
||||
def __init__(self):
|
||||
self.buyableswordsC = {
|
||||
"Baton": Baton, "Knife": Knife, "Short sword": Shortsword, "Long sword":
|
||||
Longsword, "Nun-Chakus": NunChaku, "Mace": Mace, "Claymore": Claymore,
|
||||
"Katana": Katana, "Silver dagger": Silverdagger, "Silver sword":
|
||||
Silversword, "Silver claws": Silverclaws, "Silver whip": Whip
|
||||
}
|
||||
self.buyablegunsC = {
|
||||
"Glock": Glock, "uzi": Uzi, "Kalaschnikow": Ak74, "p90 SMG": P90,
|
||||
"Sawn-off shotgun": Sawnoffshotgun, "Shotgun": Shotgun, "Sniper rifle":
|
||||
Awp, "M4 carbine": M4, "Light machine gun": Lmg
|
||||
}
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
||||
"""
|
||||
nosword = Sword("Fist", 0, "", 50, 0.0, 0.3, 0, False)
|
||||
baton = Sword("Baton", 20, "", 75, 0.0, 0.3, 20, False)
|
||||
knife = Sword("Knife", 20, "", 60, 0.2, 0.0, 30, False)
|
||||
shortsword = Sword("Short sword", 40, "", 90, 0.3, 0.0, 50, False)
|
||||
longsword = Sword("Long sword", 70, "", 120, 0.4, 0.1, 70, False)
|
||||
nunchaku = Sword("Nun-Chakus", 70, "", 80, 0.1, 0.7, 50, False)
|
||||
mace = Sword("Mace", 70, "", 100, 0.1, 0.5, 70, False)
|
||||
claymore = Sword("Claymore", 120, "", 150, 0.3, 0.2, 120, False)
|
||||
katana = Sword("Katana", 100, "", 110, 0.6, 0.1, 75, False)
|
||||
silversword = Sword("Silver sword", 90, "", 120, 0.3, 0.2, 50, True)
|
||||
silverdagger = Sword("Silver dagger", 40, "", 60, 0.2, 0.0, 30, True)
|
||||
whip = Sword("Silver whip", 60, "", 150, 0.7, 0.8, 30, True)
|
||||
krallen = Sword("Claws", 50, "", 50, 0.3, 0.6, 30, False)
|
||||
silverkrallen = Sword("Silver Claws", 150, "", 50, 0.4, 0.7, 30, True)
|
||||
|
||||
nogun = Gun("No gun", 0, "", 0, 0, 0)
|
||||
glock = Gun("Glock", 30, "", 10, 8, 100)
|
||||
uzi = Gun("Uzi", 50, "", 10, 6, 50)
|
||||
ak74 = Gun("Kalaschnikow", 80, "", 30, 10, 100)
|
||||
p90 = Gun("p90 SMG", 60, "", 15, 8, 75)
|
||||
sawnoffshotgun = Gun("Sawn-off shotgun", 30, "", 50, 4, 150)
|
||||
shotgun = Gun("Shotgun", 80, "", 70, 6, 150)
|
||||
awp = Gun("Sniper rifle", 140, "", 90, 15, 175)
|
||||
m4 = Gun("M4 Carbine", 110, "", 25, 12, 75)
|
||||
lmg = Gun("Light machine gun", 130, "", 10, 4, 25)
|
||||
|
||||
|
||||
|
||||
# UPGRADES
|
||||
|
||||
Verlaengerter Lauf
|
||||
R += 2
|
||||
C: 60
|
||||
|
||||
Halbmantelgeschosse
|
||||
D += 5
|
||||
C: 60
|
||||
|
||||
Verbesserte Mechanik
|
||||
F += 1
|
||||
C: 60
|
||||
|
||||
Keramikwaffe # erhoeht Bewegunsgeschwindigkeit
|
||||
movement += 1
|
||||
C: 60
|
||||
|
||||
Silberkugeln
|
||||
if target.race != "human":
|
||||
D += 10
|
||||
C: 80
|
||||
|
||||
|
||||
"""
|
||||
|
||||
"""
|
||||
# List format:
|
||||
"""
|
||||
# Swords
|
||||
nosword = ["Fist", 0, "", 50, 0.0, 0.3, 0, False]
|
||||
baton = ["Baton", 20, "swords/baton.gif", 75, 0.0, 0.3, 20, False]
|
||||
knife = ["Knife", 20, "swords/knife.gif", 60, 0.2, 0.0, 30, False]
|
||||
shortsword = ["Short sword", 40, "swords/shortsword.gif", 90, 0.3, 0.0, 50, False]
|
||||
longsword = ["Long sword", 70, "swords/longsword.gif", 120, 0.4, 0.1, 70, False]
|
||||
nunchaku = ["Nun-Chakus", 70, "swords/nunchaku.gif", 80, 0.1, 0.7, 50, False]
|
||||
mace = ["Mace", 70, "swords/mace.gif", 100, 0.1, 0.5, 70, False]
|
||||
claymore = ["Claymore", 120, "swords/claymore.gif", 150, 0.3, 0.2, 120, False]
|
||||
katana = ["Katana", 100, "swords/katana.gif", 110, 0.6, 0.1, 75, False]
|
||||
silversword = ["Silver sword", 90, "swords/silversword.gif", 120, 0.3, 0.2, 50, True]
|
||||
silverdagger = ["Silver dagger", 40, "swords/silverdagger.gif", 60, 0.2, 0.0, 30, True]
|
||||
whip = ["Silver whip", 60, "swords/whip.gif", 150, 0.7, 0.8, 30, True]
|
||||
krallen = ["Claws", 50, "swords/claws.gif", 50, 0.3, 0.6, 30, False]
|
||||
silverkrallen = ["Silberkrallen", 30, "swords/silverclaws.gif", 50, 0.4, 0.7, 150, True]
|
||||
|
||||
|
||||
# Guns
|
||||
nogun = ["No gun", 0, "", 0, 0, 0]
|
||||
glock = ["Glock", 30, "guns/glock.gif", 10, 8, 100]
|
||||
uzi = ["Uzi", 50, "guns/uzi.gif", 10, 6, 50]
|
||||
ak74 = ["Kalaschnikow", 80, "guns/kalaschnikow.gif", 30, 10, 100]
|
||||
p90 = ["p90 SMG", 60, "guns/p90.gif", 15, 8, 75]
|
||||
sawnoffshotgun = ["Sawn-off shotgun", 30, "guns/sawnoff.gif", 50, 4, 150]
|
||||
shotgun = ["Shotgun", 80, "guns/shotgun.gif", 70, 6, 150]
|
||||
awp = ["Sniper rifle", 140, "guns/sniper.gif", 90, 15, 175]
|
||||
m4 = ["M4 Carbine", 110, "guns/m4carbine.gif", 25, 12, 75]
|
||||
lmg = ["Light machine gun", 130, "guns/lmg.gif", 10, 4, 25]
|
||||
|
||||
allswords = [baton, knife, shortsword, longsword, nunchaku, mace, claymore, katana, silverdagger, silversword,
|
||||
silverkrallen, whip]
|
||||
guns = [glock, uzi, ak74, p90, sawnoffshotgun, shotgun, awp, m4, lmg]
|
579
code/old_functions.py
Normal file
|
@ -0,0 +1,579 @@
|
|||
"""
|
||||
This is a file for functions, which were used in the pre-pySDL2 game version.
|
||||
They are no longer in use, so ignore warnings.
|
||||
currently game is imported totally, so everything in here resolves.
|
||||
"""
|
||||
|
||||
from game import *
|
||||
|
||||
|
||||
def levelup(player):
|
||||
""" raise player level
|
||||
|
||||
tested, whenever experience ist earned
|
||||
:param player: object
|
||||
:return: object
|
||||
"""
|
||||
if "learning software" in player.aug:
|
||||
lvlup = player.experience > player.level * 10 - 15
|
||||
else:
|
||||
lvlup = player.experience > player.level * 10
|
||||
if lvlup:
|
||||
player.level += 1
|
||||
print("You gained one level! You can now raise an attribute.")
|
||||
choice = 0
|
||||
while choice == 0: # can this be optimized?
|
||||
print("(0) Show character")
|
||||
print("(1) Intelligence")
|
||||
print("(2) Constitution")
|
||||
print("(3) Strength")
|
||||
print("(4) Agility")
|
||||
print("(5) Mobility")
|
||||
try:
|
||||
choice = int(raw_input("What do you want to raise? "))
|
||||
except NameError:
|
||||
choice = 0
|
||||
if choice == 0:
|
||||
player.print_char()
|
||||
elif choice == 1:
|
||||
player.int += 1
|
||||
elif choice == 2:
|
||||
player.con += 1
|
||||
elif choice == 3:
|
||||
player.str += 1
|
||||
elif choice == 4:
|
||||
player.agi += 1
|
||||
elif choice == 5:
|
||||
player.mob += 1
|
||||
else:
|
||||
print("ERROR: Enter a number between 0 and 5.")
|
||||
choice = 0
|
||||
player.update_max_hp()
|
||||
return player
|
||||
|
||||
|
||||
def near(char):
|
||||
""" tests if someone is on the 8 fields surrounding char.
|
||||
|
||||
:param char: Char object
|
||||
:return: list of char objects
|
||||
"""
|
||||
return [] # for now.
|
||||
|
||||
|
||||
def dead(player, mission):
|
||||
""" test, if someone died.
|
||||
|
||||
is executed in start_level(). if the player died, level is ended, going
|
||||
back to profile menu
|
||||
:param player: Individuum object
|
||||
:param mission: Mission object
|
||||
:return object, object, boolean
|
||||
"""
|
||||
level_running = True
|
||||
for i in mission.current_room.foelist:
|
||||
if i.hp < 1:
|
||||
player.experience += i.experience
|
||||
player = levelup(player)
|
||||
try:
|
||||
if i.target == True:
|
||||
pass # mission.target_enemy -= 1
|
||||
except AttributeError:
|
||||
pass
|
||||
if player.hp < 1:
|
||||
print("You died.")
|
||||
level_running = False
|
||||
return player, mission, level_running
|
||||
|
||||
|
||||
def shoot(char, victim):
|
||||
""" if the shot hits, the damage is dealt.
|
||||
|
||||
all parameters and returns are character objects.
|
||||
char always means the acting character object, not only the player.
|
||||
"""
|
||||
print char.name, " shoots at ", victim.name, " with a ", char.gun.name, "."
|
||||
if randint(1, 100) > 100 - (char.agi * 7 + char.int * 3):
|
||||
victim.hp -= char.gun.damage
|
||||
print("The shot hits and does " + str(char.gun.damage) + " damage.")
|
||||
else:
|
||||
print("The shot doesn't hit.")
|
||||
return char, victim
|
||||
|
||||
|
||||
def choose_gun(char):
|
||||
""" equip a gun.
|
||||
|
||||
weapon change. is necessary for current game mechanics.
|
||||
maybe we could do that... differently? GUI ftw
|
||||
char always means the acting character object, not only the player.
|
||||
:param char: object
|
||||
:return: object
|
||||
"""
|
||||
print "Name - Damage - Range - AP"
|
||||
for i in char.inventory:
|
||||
if i.type == "gun":
|
||||
print i.name, " ", str(i.damage), " ", str(i.grange), " ", str(i.ap)
|
||||
choice = 0
|
||||
while choice == 0:
|
||||
choice = raw_input("You currently have " + char.gun.name +
|
||||
" equipped. Which one do you choose? (a)bort\n")
|
||||
if choice == "a":
|
||||
print("Aborted.")
|
||||
return char
|
||||
for i in char.inventory:
|
||||
if choice == i.name and i.type == "gun":
|
||||
char.gun = i
|
||||
print("Don't hurt anyone with that.")
|
||||
return char
|
||||
print("ERROR: incorrect input.")
|
||||
choice = 0
|
||||
|
||||
|
||||
def aim(char, mission):
|
||||
""" who do i shoot?
|
||||
|
||||
from a list of characters in sight (and range?) of char, a victim is
|
||||
chosen. for now every character is in sight, changes with GUI.
|
||||
char always means the acting character object, not only the player.
|
||||
:param char: object
|
||||
:param mission: object.
|
||||
:return: object, object
|
||||
"""
|
||||
print("0: Abort")
|
||||
for i in mission.current_room.foelist:
|
||||
print(str(i.id) + ": " + str(i.name))
|
||||
victim = 0
|
||||
while victim == 0:
|
||||
try:
|
||||
victim = int(raw_input(char.name + ", who do you want to shoot?"))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
victim = 0
|
||||
if victim == 0:
|
||||
return mission, None
|
||||
for i in mission.current_room.foelist:
|
||||
if i.id == victim:
|
||||
victim = i
|
||||
break
|
||||
return mission, victim
|
||||
|
||||
|
||||
def act(char, icdifference, mission):
|
||||
""" choose action for turn, calculate AP.
|
||||
|
||||
This function handles each turn. The action is chosen.
|
||||
then it adds the AP to the acting char.
|
||||
char always means the acting character object, not only the player.
|
||||
:param char: object
|
||||
:param icdifference: integer
|
||||
:param mission: object.
|
||||
:return: mission: object
|
||||
"""
|
||||
if "reflex chip" in char.augmentations:
|
||||
char.ic -= 10
|
||||
if char == mission.current_room.foelist[0]: # if char == player
|
||||
choice = 0
|
||||
while choice == 0: # can this be optimized?
|
||||
print("(0) Show character")
|
||||
print("(1) Walk: " + str(char.walk_ap()) + " AP")
|
||||
print("(2) Choose gun: 0 AP")
|
||||
print("(3) Choose sword: 0 AP")
|
||||
print("(4) Shoot: " + str(char.gun.ap) + " AP")
|
||||
print("(5) Fight: " + str(char.sword.ap) + " AP")
|
||||
print("(6) Wait and give away " + str(icdifference) + " AP")
|
||||
if char.morph:
|
||||
print("(7) Morph: " + str(130 / ((char.mob * 3 + char.int * 5) / 10)))
|
||||
try:
|
||||
choice = int(raw_input("What do you want to do? "))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
choice = 0
|
||||
if choice == 0:
|
||||
char.print_char()
|
||||
elif choice == 1:
|
||||
# walk()
|
||||
print("You walk somewhere.") # debug
|
||||
char.ic += char.walk_ap()
|
||||
return mission
|
||||
elif choice == 2:
|
||||
choose_gun(char)
|
||||
return mission
|
||||
elif choice == 3:
|
||||
# choose_sword()
|
||||
print("Swords are not implemented yet.") # debug
|
||||
return mission
|
||||
elif choice == 4:
|
||||
if "fear blocker" not in char.augmentations:
|
||||
if near(char) != []:
|
||||
return mission
|
||||
if char.morphed:
|
||||
print("You cannot attack while morphed.")
|
||||
return mission
|
||||
# choose a target
|
||||
mission, victim = aim(char, mission)
|
||||
if victim is not None:
|
||||
char, victim = shoot(char, victim) # does the damage
|
||||
char.ic += char.gun.ap / ((char.mob * 3 + char.int * 5) / 10)
|
||||
return mission
|
||||
elif choice == 5:
|
||||
# near() # returns a list with characters near you
|
||||
# melee() # does the damage
|
||||
print("You aren't near anyone.") # debug
|
||||
# if you hit someone, do this:
|
||||
char.ic += char.sword.ap / ((char.mob * 3 + char.int * 5) / 10)
|
||||
return mission
|
||||
elif choice == 6:
|
||||
print("You wait.")
|
||||
char.ic += icdifference + 1
|
||||
return mission
|
||||
elif choice == 7:
|
||||
if char.morph:
|
||||
if char.morphed:
|
||||
char.morphed = False
|
||||
char.ic += 130 / ((char.mob * 3 + char.int * 5) / 10)
|
||||
elif not char.morphed:
|
||||
char.morphed = True
|
||||
char.ic += 130 / ((char.mob * 3 + char.int * 5) / 10)
|
||||
return mission
|
||||
else:
|
||||
print("ERROR: Enter a number between 1 and 6.")
|
||||
else:
|
||||
print("ERROR: Enter a number between 1 and 6.")
|
||||
choice = 0
|
||||
else:
|
||||
# aiturn()
|
||||
char.ic += 1 # debug
|
||||
return mission
|
||||
pass
|
||||
|
||||
|
||||
def initiative(player, mission):
|
||||
""" who has the lowest initiative and can act?
|
||||
|
||||
:param player: object
|
||||
:param mission: object
|
||||
:param foelist: list of objects
|
||||
:return player: object
|
||||
:return mission: object
|
||||
:return foelist: list of character objects
|
||||
"""
|
||||
lowest_ic = player
|
||||
for i in mission.room.foelist:
|
||||
if i.ic <= lowest_ic.ic:
|
||||
icdifference = lowest_ic.ic - i.ic
|
||||
lowest_ic = i
|
||||
mission = act(lowest_ic, icdifference, mission)
|
||||
return player, mission
|
||||
|
||||
|
||||
def start_level(player, mission):
|
||||
""" choose level and loop through it.
|
||||
|
||||
choose a level. there will be level description and choosing soon.
|
||||
calls build_battlefield to start the level, and uses while-loop
|
||||
to keep it running.
|
||||
:param player: object
|
||||
:return player: object
|
||||
"""
|
||||
print(mission.description)
|
||||
mission = build_battlefield(player, mission)
|
||||
# returns a list of lists of the fields, a dict with enemy types,
|
||||
# and a list with every enemy in the level and his IC.
|
||||
level_running = True
|
||||
while level_running:
|
||||
player, mission = initiative(player, mission)
|
||||
player, mission, level_running = dead(player, mission)
|
||||
mission.success_func(player, mission.room)
|
||||
return player
|
||||
|
||||
|
||||
def choose_level():
|
||||
""" Choose mission function
|
||||
|
||||
if function returns 0, it goes back to main menu.
|
||||
:return: player: object
|
||||
"""
|
||||
all_missions = os.listdir("../missions")
|
||||
if all_missions:
|
||||
choice = -1
|
||||
while choice == -1: # can this be optimized?
|
||||
print("(0) Abort")
|
||||
for i in range(len(all_missions)):
|
||||
print("(%s) " + all_missions[i]) % str(i + 1)
|
||||
try:
|
||||
choice = int(raw_input("Which mission do you want to start?"))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
choice = -1
|
||||
if choice == 0:
|
||||
print("Choosing aborted.")
|
||||
return 0
|
||||
elif choice - 1 < len(all_missions) and choice > 0:
|
||||
with open("../missions/" + all_missions[choice - 1], "rb", ) as file:
|
||||
mission = pickle.load(file)
|
||||
return mission
|
||||
else:
|
||||
print("ERROR: Invalid choice.")
|
||||
choice = -1
|
||||
else:
|
||||
print("ERROR: No available missions.")
|
||||
return 0
|
||||
|
||||
|
||||
def buy_gun(player):
|
||||
""" choose item and pay for it.
|
||||
|
||||
choose an item. add it to player.inventory, reduce player.bitcoins.
|
||||
items.allguns: list of guns
|
||||
:param player: object
|
||||
:return: player: object
|
||||
"""
|
||||
with open("../resources/guns", "rb") as file:
|
||||
guns = pickle.load(file)
|
||||
for i in guns:
|
||||
print "Item: " + i[0],
|
||||
leftspace = 20 - len(i[0])
|
||||
print leftspace * "_",
|
||||
if "cosmetic surgery" in player.augmentations:
|
||||
cost = i[1] - 10
|
||||
else:
|
||||
cost = i[1]
|
||||
print "Price: " + str(cost) + " BTC"
|
||||
choice = 0
|
||||
while choice == 0:
|
||||
print("You have " + str(player.bitcoins) + " BTC.")
|
||||
try:
|
||||
choice = raw_input("Which gun do you want to buy? (a)bort ")
|
||||
except SyntaxError:
|
||||
choice = 0
|
||||
print("ERROR: Incorrect input.")
|
||||
if choice == "a":
|
||||
return player
|
||||
for i in guns:
|
||||
if choice == i[0]:
|
||||
if "cosmetic surgery" in player.augmentations:
|
||||
cost = i[1] - 10
|
||||
else:
|
||||
cost = i[1]
|
||||
if cost > player.bitcoins:
|
||||
print("Gun is too expensive.")
|
||||
return player
|
||||
else:
|
||||
player.bitcoins -= cost
|
||||
player.inventory.append(build_gun(i))
|
||||
print("Don't hurt anyone with that.")
|
||||
return player
|
||||
print("ERROR: Incorrect input.")
|
||||
choice = 0
|
||||
|
||||
|
||||
def sell(player):
|
||||
""" not yet implemented. maybe when the GUI is coming? """
|
||||
print("You have:")
|
||||
for i in player.inventory:
|
||||
print i.name
|
||||
print("I won't buy your shit.")
|
||||
|
||||
|
||||
def get_augments(player):
|
||||
choice = 0
|
||||
while choice == 0:
|
||||
print("Your augmentations:")
|
||||
for i in player.augmentations:
|
||||
print i
|
||||
print(" 0: Abort")
|
||||
print(" 1: Get rid of augmentation")
|
||||
for i in range(len(augmentations.all_augmentations)):
|
||||
if i < 8: # nice output
|
||||
print "",
|
||||
print (str(i + 2) + ": " + augmentations.all_augmentations[i])
|
||||
try:
|
||||
choice = int(raw_input("Which augmentation do you want to get? (costs 100 BTC) "))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
if choice == 0:
|
||||
return player
|
||||
if choice == 1:
|
||||
while choice == 1:
|
||||
print("0: Abort")
|
||||
for i in range(len(player.augmentations)):
|
||||
print (str(i + 1) + ": " + player.augmentations[i])
|
||||
try:
|
||||
choice = int(raw_input("Which augmentation do you want to get rid of? "))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
if choice == 0:
|
||||
return player
|
||||
elif choice > 0 and choice <= len(player.augmentations):
|
||||
player = augmentations.deaugment(player, player.augmentations[choice - 1])
|
||||
return player
|
||||
else:
|
||||
print("ERROR: Incorrect input.")
|
||||
choice = 1
|
||||
elif choice <= i and choice > 0:
|
||||
player = augmentations.augment(player, augmentations.all_augmentations[choice - 2])
|
||||
return player
|
||||
else:
|
||||
print("ERROR: Incorrect input.")
|
||||
|
||||
|
||||
def merchant(player):
|
||||
""" choose merchant option.
|
||||
|
||||
needs to be reworked when there is an engine
|
||||
:param player: object
|
||||
:return: player: object
|
||||
"""
|
||||
choice = 0
|
||||
while choice == 0:
|
||||
print "(0) Show character"
|
||||
print "(1) Buy a gun"
|
||||
print "(2) Sell an item"
|
||||
print "(3) Get an augmentation"
|
||||
print "(4) Back to profile"
|
||||
try:
|
||||
choice = int(raw_input("What do you want to do? "))
|
||||
except ValueError:
|
||||
choice = 0
|
||||
if choice == 0:
|
||||
player.print_char()
|
||||
elif choice == 1: # if clicked on buyable item,
|
||||
buy_gun(player)
|
||||
elif choice == 2:
|
||||
if len(player.inventory) == 0:
|
||||
print("You have nothing to sell.")
|
||||
else:
|
||||
sell(player)
|
||||
elif choice == 3:
|
||||
get_augments(player)
|
||||
elif choice == 4:
|
||||
return player
|
||||
choice = 0
|
||||
|
||||
|
||||
def profile(player):
|
||||
""" This is the profile menu. from here you can buy stuff or start levels. """
|
||||
choice = 0
|
||||
while choice == 0: # can this be optimized?
|
||||
print "(0) Show character"
|
||||
print "(1) Visit the merchant"
|
||||
print "(2) Take a job offer"
|
||||
print "(3) Main Menu"
|
||||
try:
|
||||
choice = int(raw_input("What do you want to do? "))
|
||||
except NameError:
|
||||
choice = 0
|
||||
if choice == 0:
|
||||
player.print_char()
|
||||
elif choice == 1:
|
||||
player = merchant(player)
|
||||
player.save_profile()
|
||||
elif choice == 2:
|
||||
mission = choose_mission()
|
||||
if mission != 0:
|
||||
player = start_level(player, mission)
|
||||
player.save_profile()
|
||||
elif choice == 3:
|
||||
return
|
||||
else:
|
||||
print("ERROR: Enter a number between 1 and 4.")
|
||||
choice = 0
|
||||
|
||||
|
||||
def load_game():
|
||||
""" Loading game function
|
||||
|
||||
if function returns 0, it goes back to main menu.
|
||||
:return: player: object
|
||||
"""
|
||||
saved_games = os.listdir("../saves")
|
||||
if saved_games:
|
||||
choice = -1
|
||||
while choice == -1: # can this be optimized?
|
||||
print("(0) Abort")
|
||||
for i in range(len(saved_games)):
|
||||
print("(%s) " + saved_games[i]) % str(i + 1)
|
||||
try:
|
||||
choice = int(raw_input("Which character do you want to load? "))
|
||||
except ValueError:
|
||||
print("ERROR: Enter a number.")
|
||||
choice = -1
|
||||
if choice == 0:
|
||||
print("Loading aborted.")
|
||||
return 0
|
||||
elif choice - 1 < len(saved_games) and choice > 0:
|
||||
with open("../saves/" + saved_games[choice - 1], "rb", ) as file:
|
||||
player = pickle.load(file)
|
||||
return player
|
||||
else:
|
||||
print("ERROR: Invalid choice.")
|
||||
choice = -1
|
||||
else:
|
||||
print("ERROR: No saved games.")
|
||||
return 0
|
||||
|
||||
|
||||
def create_character():
|
||||
""" returns player object, prints the character """
|
||||
name = ""
|
||||
while name == "":
|
||||
name = raw_input("What's your name? ")
|
||||
choice = 0
|
||||
while choice == 0: # can this be optimized?
|
||||
print("(1) Vampire\n(2) Angel\n(3) Werewolf\n(4) Golem")
|
||||
try:
|
||||
choice = int(raw_input("What are you? "))
|
||||
except ValueError:
|
||||
choice = 0
|
||||
if choice == 0:
|
||||
print("ERROR: Enter a number.")
|
||||
elif choice == 1:
|
||||
player = Vampire(name)
|
||||
elif choice == 2:
|
||||
player = Angel(name)
|
||||
elif choice == 3:
|
||||
player = Werewolf(name)
|
||||
elif choice == 4:
|
||||
player = Golem(name)
|
||||
else:
|
||||
print("ERROR: Enter a number between 1 and 4.")
|
||||
choice = 0
|
||||
print("Your new character:")
|
||||
player.print_char()
|
||||
player.save_profile()
|
||||
return player
|
||||
|
||||
|
||||
def main_menu():
|
||||
""" Main Menu, from here the other functions are started. """
|
||||
choice = 0
|
||||
while choice == 0: # can this be optimized?
|
||||
print("(1) New game\n(2) Load game\n(3) Options\n(4) Exit")
|
||||
try:
|
||||
choice = int(raw_input("What do you want to do? "))
|
||||
except ValueError:
|
||||
choice = 0
|
||||
if choice == 0:
|
||||
print("ERROR: Enter a number.")
|
||||
elif choice == 1:
|
||||
player = create_character()
|
||||
profile(player)
|
||||
elif choice == 2:
|
||||
player = load_game()
|
||||
if player == 0:
|
||||
pass
|
||||
else:
|
||||
profile(player)
|
||||
elif choice == 3:
|
||||
pass # options
|
||||
elif choice == 4:
|
||||
print("Good Bye.")
|
||||
exit()
|
||||
else:
|
||||
print("ERROR: Enter a number between 1 and 4.")
|
||||
choice = 0
|
||||
|
||||
|
||||
def main():
|
||||
main_menu()
|
BIN
images/augmentations/artificial_leg.gif
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
images/augmentations/blessed_by_luck.gif
Normal file
After Width: | Height: | Size: 741 B |
BIN
images/augmentations/cosmetic_surgery.gif
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
images/augmentations/eye_processor.gif
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
images/augmentations/fear_blocker.gif
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
images/augmentations/genetic_surgery.gif
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
images/augmentations/kevlar_implant.gif
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
images/augmentations/learning_software.gif
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
images/augmentations/reflex_chip.gif
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
images/augmentations/wallhack.gif
Normal file
After Width: | Height: | Size: 189 B |
BIN
images/characters/1one.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/characters/2two.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/characters/3three.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/characters/4four.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/characters/5five.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/characters/6six.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/characters/7seven.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/characters/8eight.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/characters/9nine.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/characters/angel.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/characters/player.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/characters/vampire.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/characters/werewolf.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/charwinexample.gif
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
images/charwinexample.xcf
Normal file
BIN
images/fields/0leer.gif
Normal file
After Width: | Height: | Size: 58 B |
BIN
images/fields/barricada.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/fields/door.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/fields/loot.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/fields/treasure.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/fields/wall.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/guns/glock.gif
Normal file
After Width: | Height: | Size: 932 B |
BIN
images/guns/kalaschnikow.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/guns/lmg.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/guns/m4carbine.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/guns/p90.gif
Normal file
After Width: | Height: | Size: 972 B |
BIN
images/guns/sawnoff.gif
Normal file
After Width: | Height: | Size: 1,020 B |
BIN
images/guns/shotgun.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/guns/sniper.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/guns/uzi.gif
Normal file
After Width: | Height: | Size: 972 B |
BIN
images/kreis.gif
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
images/panels/charwinbackground.gif
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
images/panels/consolebackground.gif
Normal file
After Width: | Height: | Size: 256 B |
BIN
images/panels/emptyfields.gif
Normal file
After Width: | Height: | Size: 585 B |
BIN
images/panels/inventorybackground.gif
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
images/panels/midpanel.gif
Normal file
After Width: | Height: | Size: 94 KiB |
BIN
images/panels/sidepanel.gif
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
images/panels/spellpanel.gif
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
images/panels/textpanel.gif
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
images/panels2/augframe.gif
Normal file
After Width: | Height: | Size: 691 B |
BIN
images/panels2/backbutton.gif
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
images/panels2/charwinbackground.gif
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
images/panels2/consolebackground.gif
Normal file
After Width: | Height: | Size: 252 B |
BIN
images/panels2/emptyfields.gif
Normal file
After Width: | Height: | Size: 998 B |
BIN
images/panels2/highpanel.gif
Normal file
After Width: | Height: | Size: 208 KiB |
BIN
images/panels2/inventorybackground.gif
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
images/panels2/leftpanel.gif
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
images/panels2/rightmidpanel.gif
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
images/panels2/spellbutton.gif
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
images/panels2/textpanel.gif
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
images/races/Angel.gif
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
images/races/Golem.gif
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
images/races/Vampire.gif
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
images/races/Werewolf.gif
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
images/swords/baton.gif
Normal file
After Width: | Height: | Size: 894 B |
BIN
images/swords/claws.gif
Normal file
After Width: | Height: | Size: 933 B |
BIN
images/swords/claymore.gif
Normal file
After Width: | Height: | Size: 951 B |
BIN
images/swords/katana.gif
Normal file
After Width: | Height: | Size: 972 B |
BIN
images/swords/knife.gif
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
images/swords/longsword.gif
Normal file
After Width: | Height: | Size: 982 B |
BIN
images/swords/mace.gif
Normal file
After Width: | Height: | Size: 950 B |
BIN
images/swords/nunchaku.gif
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
images/swords/shortsword.gif
Normal file
After Width: | Height: | Size: 987 B |
BIN
images/swords/silverclaws.gif
Normal file
After Width: | Height: | Size: 907 B |
BIN
images/swords/silverdagger.gif
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
images/swords/silversword.gif
Normal file
After Width: | Height: | Size: 958 B |
BIN
images/swords/whip.gif
Normal file
After Width: | Height: | Size: 897 B |
1661
missions/H14
Normal file
1298
missions/Sewers
Normal file
688
missions/test
Normal file
|
@ -0,0 +1,688 @@
|
|||
ccopy_reg
|
||||
_reconstructor
|
||||
p0
|
||||
(cgame
|
||||
Mission
|
||||
p1
|
||||
c__builtin__
|
||||
object
|
||||
p2
|
||||
Ntp3
|
||||
Rp4
|
||||
(dp5
|
||||
S'room'
|
||||
p6
|
||||
g0
|
||||
(cgame
|
||||
Room
|
||||
p7
|
||||
g2
|
||||
Ntp8
|
||||
Rp9
|
||||
(dp10
|
||||
S'id'
|
||||
p11
|
||||
I140320712709200
|
||||
sS'fields'
|
||||
p12
|
||||
(lp13
|
||||
(lp14
|
||||
S'O'
|
||||
p15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aS'W'
|
||||
p16
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp17
|
||||
S'T'
|
||||
p18
|
||||
ag15
|
||||
aI1
|
||||
ag15
|
||||
ag15
|
||||
ag16
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aI1
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp19
|
||||
g15
|
||||
ag15
|
||||
aI1
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aI1
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp20
|
||||
g15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag16
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp21
|
||||
g16
|
||||
ag16
|
||||
ag16
|
||||
ag16
|
||||
ag16
|
||||
ag16
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp22
|
||||
g15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp23
|
||||
g15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp24
|
||||
g15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aI1
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp25
|
||||
g15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp26
|
||||
g15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp27
|
||||
g15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp28
|
||||
g15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp29
|
||||
g15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aI1
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp30
|
||||
g15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp31
|
||||
g15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aI1
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp32
|
||||
g15
|
||||
ag16
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp33
|
||||
g15
|
||||
ag16
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aS'B'
|
||||
p34
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp35
|
||||
g15
|
||||
ag16
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag34
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aa(lp36
|
||||
g15
|
||||
ag16
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag34
|
||||
aI0
|
||||
ag15
|
||||
ag15
|
||||
aa(lp37
|
||||
g15
|
||||
ag16
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
ag34
|
||||
ag15
|
||||
ag15
|
||||
ag15
|
||||
aasS'fielddata'
|
||||
p38
|
||||
(dp39
|
||||
sS'description'
|
||||
p40
|
||||
S'Wide test area'
|
||||
p41
|
||||
sbsS'target_enemy'
|
||||
p42
|
||||
I0
|
||||
sS'target_item'
|
||||
p43
|
||||
S'Treasure'
|
||||
p44
|
||||
sS'rooms'
|
||||
p45
|
||||
(lp46
|
||||
g9
|
||||
asS'rewardmoney'
|
||||
p47
|
||||
I50
|
||||
sS'rewardxp'
|
||||
p48
|
||||
I10
|
||||
sS'rewarditems'
|
||||
p49
|
||||
(lp50
|
||||
sS'current_room'
|
||||
p51
|
||||
g9
|
||||
sS'target_coordinates'
|
||||
p52
|
||||
Nsg40
|
||||
S'Get the Treasure and leave through the tunnel.'
|
||||
p53
|
||||
sb.
|
97
notes/Magic.txt
Normal file
|
@ -0,0 +1,97 @@
|
|||
# Magic
|
||||
|
||||
There are a lot of words which can be used to describe a spell.
|
||||
These words are then interpreted by the computer, who creates an effect.
|
||||
|
||||
A working spell has these components:
|
||||
|
||||
Target
|
||||
Effect
|
||||
Intensity
|
||||
Condition
|
||||
Probability
|
||||
|
||||
If the caster doesn't specify all criteria, the computer decides what exactly happens and how the rest is computed.
|
||||
Every spell also costs Mana Points, which are calculated out of the effect of the resulting spell.
|
||||
Every spell word costs as much APs, as much syllables it has.
|
||||
|
||||
|
||||
|
||||
# Vocabulary
|
||||
|
||||
other words:
|
||||
Not
|
||||
much
|
||||
few
|
||||
done! (0 AP)
|
||||
|
||||
intensity words:
|
||||
much
|
||||
few
|
||||
wide
|
||||
one
|
||||
three
|
||||
five
|
||||
ten
|
||||
75
|
||||
50
|
||||
40
|
||||
20
|
||||
100
|
||||
1000
|
||||
full
|
||||
|
||||
probability words:
|
||||
rarely, but
|
||||
sure
|
||||
often
|
||||
never (fuck yeah, double negation)
|
||||
|
||||
target words:
|
||||
me
|
||||
human
|
||||
wolf
|
||||
angel
|
||||
vampire
|
||||
police
|
||||
people
|
||||
|
||||
effect words:
|
||||
heal
|
||||
burn
|
||||
sleep
|
||||
stun
|
||||
damage
|
||||
siphon life
|
||||
death
|
||||
calm
|
||||
forget
|
||||
conjure
|
||||
morph/unmorph
|
||||
|
||||
condition words:
|
||||
life
|
||||
melee
|
||||
stunned
|
||||
all
|
||||
|
||||
# Grammar
|
||||
|
||||
the order of the words has to be:
|
||||
probability effect condition target intensity done!
|
||||
|
||||
other words have to be related to some of these, and then always have to be before their relation word.
|
||||
all human
|
||||
not me
|
||||
|
||||
|
||||
possible sentences are:
|
||||
|
||||
sure burn all human much
|
||||
sleep three police three
|
||||
stun police melee
|
||||
|
||||
wrong sentences are:
|
||||
|
||||
human sleep # before effect can only be a probability word, no target.
|
||||
much heal me # much isn't a intensity word at that place and can't be related to heal.
|
462
notes/Notizen.txt
Normal file
|
@ -0,0 +1,462 @@
|
|||
# # # # #
|
||||
# TO-DO #
|
||||
# # # # #
|
||||
realise game in pySDL2
|
||||
enemy list system: import data from pickle file.
|
||||
document how enemy, mission, item, player data is packed.
|
||||
change player.bitcoins back to 50
|
||||
|
||||
|
||||
# Misc
|
||||
|
||||
|
||||
# Function flow
|
||||
|
||||
create window
|
||||
main Menu
|
||||
character creation
|
||||
player.save_profile
|
||||
profile/computer
|
||||
merchant
|
||||
player.save_profile
|
||||
level choice
|
||||
build_battlefield
|
||||
start_level
|
||||
initiative
|
||||
your_turn
|
||||
act
|
||||
walk
|
||||
test_new_level # test: was a door accessed?
|
||||
test_item_found # test: was an item found?
|
||||
cast_spell # write a spell
|
||||
melee_skill # did you hit?
|
||||
melee_damage # deal damage
|
||||
aim
|
||||
shoot
|
||||
ai_turn
|
||||
state # which action?
|
||||
act # execute action
|
||||
player_seen # if player sees action, animation
|
||||
dead # did someone die?
|
||||
player.save_profile
|
||||
|
||||
|
||||
main_menu_sdl
|
||||
new_game_sdl
|
||||
choose_game_sdl
|
||||
profile_sdl
|
||||
build_profile_sdl
|
||||
merchant_sdl
|
||||
buy_gun_sdl
|
||||
buy_sword_sdl
|
||||
choose_mission
|
||||
run_mission
|
||||
run_room
|
||||
display_fields
|
||||
|
||||
|
||||
|
||||
# Classes
|
||||
|
||||
Individuum
|
||||
Vampire
|
||||
Werewolf
|
||||
Angel
|
||||
Golem
|
||||
|
||||
Enemy
|
||||
|
||||
Item
|
||||
Swords
|
||||
Guns
|
||||
Upgrades # to do
|
||||
|
||||
Spell?
|
||||
|
||||
|
||||
Room
|
||||
id # integer, must be unique
|
||||
fields # list of lists
|
||||
field data # dictionary for field data
|
||||
description # string - necessary?
|
||||
|
||||
Mission
|
||||
successfunc # function to check if mission is accomplished - several templates
|
||||
rewardmoney # integer
|
||||
rewarditems # list of Item-objects
|
||||
rewardxp # integer
|
||||
description # string
|
||||
room # Room-object where to start
|
||||
current_room# Room which is currently loaded
|
||||
success # dict of booleans
|
||||
|
||||
Panel(sdl2.ext.Entity)
|
||||
displays an image
|
||||
|
||||
TextSprite(sdl2.ext.TextureSprite)
|
||||
displays text
|
||||
|
||||
SDLInstanceManager
|
||||
contains all the pySDL2-instances.
|
||||
|
||||
ConsoleScreen
|
||||
displays console and tooltips
|
||||
|
||||
Charwindow
|
||||
displays char values, augs and inventory
|
||||
|
||||
ItemButton
|
||||
displays an item panel and button
|
||||
|
||||
|
||||
|
||||
# Mission Success Conditions
|
||||
|
||||
target_item_owned - string
|
||||
at_position - list[int, int, int(roomID)]
|
||||
target_enemy - integer (how many left?)
|
||||
|
||||
|
||||
|
||||
# Races
|
||||
|
||||
Human
|
||||
Angel
|
||||
Vampire
|
||||
Werewolf
|
||||
Golem
|
||||
|
||||
# Attributes:
|
||||
|
||||
Constitution
|
||||
Agility
|
||||
Strength
|
||||
Mobility
|
||||
Intelligence
|
||||
|
||||
They could be ordered as a pentagram.... two of them always add up do a value.
|
||||
Int
|
||||
Str___/_\___Con
|
||||
\/ \/
|
||||
/_\ /_\
|
||||
Mob Agi
|
||||
|
||||
|
||||
# Values:
|
||||
|
||||
Health Points: Con * 8 + Str * 5 + 10
|
||||
Initiative: Mob * 3 + Int * 5 / 10
|
||||
Melee Hitting: Agi * 3 + Str * 5
|
||||
Melee Defense: Mob * 5 + Con * 3
|
||||
Range Hitting: Agi * 7 + Int * 3
|
||||
Walk AP cost: 100 / Mob # maybe we find a better algorithm for that
|
||||
|
||||
|
||||
|
||||
# Initiative
|
||||
|
||||
Every action costs AP. When a character acts, these costs are added on its Initiative Counter (IC).
|
||||
At the beginning of each turn it is checked who has the lowest IC.
|
||||
The character with the lowest IC can act now. After that action, the turn ends.
|
||||
If a new character comes into the level (e.g. conjuration), its IC is set equal to the lowest IC in the level.
|
||||
An Action costs: AP / Initiative of the Character. # maybe we find a better algorithm for that
|
||||
|
||||
|
||||
|
||||
# Fighting
|
||||
maybe we find better algorithms for that.
|
||||
|
||||
Melee:
|
||||
Hitting: melee hitting(A) + random0-50 > melee defense(D) + random0-20
|
||||
Critchance: Sword.critical, if it crits, then damage * 2
|
||||
Damage: Str*5 + Weapon Damage
|
||||
|
||||
Range:
|
||||
Hitting: random1-100 > 100 - range hitting(A)
|
||||
Damage: Waffe
|
||||
|
||||
10% failchance at every test
|
||||
|
||||
|
||||
# Start Values per race
|
||||
|
||||
Golem
|
||||
Con = 7
|
||||
Str = 8
|
||||
Agi = 4
|
||||
Mob = 4
|
||||
Int = 3
|
||||
|
||||
Vampir
|
||||
Con = 5
|
||||
Str = 8
|
||||
Agi = 6
|
||||
Mob = 5
|
||||
Int = 5
|
||||
|
||||
Mensch
|
||||
Con = 4
|
||||
Str = 5
|
||||
Agi = 5
|
||||
Mob = 4
|
||||
Int = 4
|
||||
|
||||
Engel
|
||||
Kon = 4
|
||||
Str = 3
|
||||
Agi = 7
|
||||
Mob = 7
|
||||
Int = 5
|
||||
|
||||
|
||||
Werwolf
|
||||
Human Values*2
|
||||
Cant use weapons while turned
|
||||
turning costs: 130 AP
|
||||
|
||||
|
||||
# Augmentations
|
||||
|
||||
There is a 10 percent chance that a surgery fails and your constitution is permanently reduced by 1.
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
artificial leg | mobility + 2
|
||||
reflex chip | 10 % Chance each turn, that IC is reduced by 10, checked at act function
|
||||
kevlar implant | +20 max_HP, check at update_maxHP()
|
||||
eye processor | agility + 2
|
||||
cosmetic surgery | all costs -10 BTC, checked at buy_gun, buy_sword, augment function
|
||||
fear blocker | Use guns in melee, checked at act function
|
||||
wallhack | No hitting malus because of barricades
|
||||
genetic surgery | Player can morph into a werewolf: double stats, dont use weapons while morphed
|
||||
learning software | needed XP per level: -15, checked at levelup function
|
||||
blessed by luck | chance tests += 0.05, checked at chance function?
|
||||
|
||||
|
||||
# Interface
|
||||
directory: panels2
|
||||
|
||||
Panel Hierarchy: (horizontal x vertical / depth)
|
||||
root (800x600)
|
||||
leftpanel (200x150/-20) - leftpanel.gif
|
||||
charwin (180x130/-19) - charwinbackground.gif
|
||||
Text? # - charwinexample.gif
|
||||
racelogo
|
||||
vamplogo.gif
|
||||
...
|
||||
midpanel (300x150/-20) - rightmidpanel.gif
|
||||
console(280x90/0) - consolebackground.gif
|
||||
Text?
|
||||
ActionButton (25x25)
|
||||
rightpanel(300x150/-20) - rightmidpanel.gif
|
||||
SpellButton (30x30) - spellbutton.gif
|
||||
augmentations (30x90/-19) - augframe.gif
|
||||
3 augmentations (30x30)
|
||||
inventory (240x130/-19) - inventorybackground.gif
|
||||
Item (25x25)
|
||||
glock.gif
|
||||
...
|
||||
highpanel(800x450/-20) - highpanel.gif
|
||||
Fields (15x15)
|
||||
0leer.gif
|
||||
1one.gif
|
||||
wall.gif
|
||||
...
|
||||
TextPanel (var/20)
|
||||
pentagram - TODO
|
||||
emptyfields (800x450/0) - emptyfields.gif
|
||||
InfoText (var/30) - black text, yellow/beige background, open by right click, close by click on it
|
||||
|
||||
|
||||
|
||||
in Menu:
|
||||
-------------------------------------------------
|
||||
| |
|
||||
| Menu |
|
||||
| |
|
||||
| Choice1 |
|
||||
| Choice2 |
|
||||
| Choice3 |
|
||||
| Choice4 |
|
||||
| Choice5 |
|
||||
| Choice6 |
|
||||
| |
|
||||
|------------------------------------------------
|
||||
| Charwin | Go Back |Aug1 Inventory |
|
||||
| --- | --- |Aug2 --- |
|
||||
| --- | --- |Aug3 --- |
|
||||
| --- | Console |Spel --- |
|
||||
-------------------------------------------------
|
||||
If Character loaded, show Char Window, Inventory etc., even if you can't do stuff with it
|
||||
Click on Choice Option to go there
|
||||
Display Game Output in Console
|
||||
|
||||
at Merchant:
|
||||
-------------------------------------------------
|
||||
| |
|
||||
| Guns ---- Swords ---- Spells ---------- Aug-- |
|
||||
| --------- ----------- ----------------- ----- |
|
||||
| --------- ----------- ----------------- ----- |
|
||||
| --------- ----------- ----------------- ----- |
|
||||
| --------- ----------- ----------------- ----- |
|
||||
| --------- ----------- ----------------- ----- |
|
||||
| --------- ----------- ----------------- ----- |
|
||||
| --------- ----------- ----------------- ----- |
|
||||
| |
|
||||
|------------------------------------------------
|
||||
| Charwin | Go Back |Deau Inventory |
|
||||
| --- | --- |gmen --- |
|
||||
| --- | --- |t--- --- |
|
||||
| --- | Console |Spel --- |
|
||||
-------------------------------------------------
|
||||
|
||||
right click on item: see values
|
||||
click on item: open dialog if you want to buy/sell, buy/sell
|
||||
click on Spel: show Spells
|
||||
Display Game Output in Console
|
||||
|
||||
in Level:
|
||||
-------------------------------------------------
|
||||
| |
|
||||
| L |
|
||||
| |
|
||||
| E |
|
||||
| |
|
||||
| V |
|
||||
| |
|
||||
| E |
|
||||
| |
|
||||
| L |
|
||||
|------------------------------------------------
|
||||
| Charwin | Action Buttons |Aug1 Inventory |
|
||||
| --- | --- |Aug2 --- |
|
||||
| --- | --- |Aug3 --- |
|
||||
| --- | Console |Spel --- |
|
||||
-------------------------------------------------
|
||||
arrow keys: walk
|
||||
click on action fields: choose to shoot, fight, morph, wait
|
||||
click on field: use action on field
|
||||
click on item in inventory: use/equip it
|
||||
click on Spel: show Spell Screen
|
||||
right click on field: view information
|
||||
right click on item: view information
|
||||
right click on spell word: view information
|
||||
hover over field: see AP costs
|
||||
Display Game Output in Console
|
||||
|
||||
Skill Screen
|
||||
-------------------------------------------------
|
||||
| |
|
||||
| Level up |
|
||||
| |
|
||||
| Int |
|
||||
| Con Str |
|
||||
| (Pentagram) |
|
||||
| |
|
||||
| Mob Agi |
|
||||
| |
|
||||
| |
|
||||
|------------------------------------------------
|
||||
| Charwin | Confirm |Aug1 Inventory |
|
||||
| --- | --- |Aug2 --- |
|
||||
| --- | --- |Aug3 --- |
|
||||
| --- | Console |Spel --- |
|
||||
-------------------------------------------------
|
||||
click on Int etc: (Erase earlier Choice,) Skill up attribute and see values changing in Charwin
|
||||
click on Confirm: Save and return to Level screen (by destroying Levelupscreen)
|
||||
click on Spel: show Spells
|
||||
|
||||
Cast Spell screen
|
||||
-------------------------------------------------
|
||||
| |
|
||||
| Pro---- Eff---- Con--- Tar--- Int---- Oth--- |
|
||||
| ------- ------- ------ ------ ------- ------- |
|
||||
| ------- ------- ------ ------ ------- ------- |
|
||||
| ------- ------- ------ ------ ------- ------- |
|
||||
| ------- ------- ------ ------ ------- ------- |
|
||||
| ------- ------- ------ ------ ------- ------- |
|
||||
| ------- ------- ------ ------ ------- ------- |
|
||||
| ------- ------- ------ ------ ------- ------- |
|
||||
| |
|
||||
|------------------------------------------------
|
||||
| Charwin | Go Back |Aug1 Inventory |
|
||||
| --- | --- |Aug2 --- |
|
||||
| --- | --- |Aug3 --- |
|
||||
| --- | Console | --- |
|
||||
-------------------------------------------------
|
||||
Click on Spell word: add it to spell (cast it)
|
||||
|
||||
# How do important data structures look like?
|
||||
|
||||
|
||||
fields # list of lists
|
||||
field data # dictionary for field data
|
||||
description # string - necessary?
|
||||
|
||||
fields = [["W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W"],
|
||||
["W", "O", "O", "O", "T", "W", "W", "W", "W", "W", "W", "W", "W", "W", "O", "O", "O", "O", "O", "O", "W"],
|
||||
["W", "O", "O", 1 , "O", "W", "W", "W", "W", "W", "W", "W", "W", "W", "O", 4 , "O", "L", "O", "O", "W"],
|
||||
["W", "O", 1 , "O", "O", "W", "W", "W", "W", "W", "W", "W", "W", "W", "O", "O", "O", "W", "W", "W", "W"],
|
||||
["W", "O", "B", "B", "B", "W", "W", "W", 2 , 2 , "W", "W", "W", "W", "O", "O", "O", "W", "W", "W", "W"],
|
||||
["W", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "W", "W", "W", "W"],
|
||||
["W", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", 3 , "W", "W", "W"],
|
||||
["W", "O", "O", "O", 4 , "O", "O", "O", "O", 1 , "O", 1 , "O", "O", "O", "O", "O", "W", "W", "W", "W"],
|
||||
["W", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "W", "W", "W", "W"],
|
||||
["W", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "W"],
|
||||
["W", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", 1 , "O", "O", "O", 1 , "O", "O", "O", "W"],
|
||||
["W", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "W"],
|
||||
["W", "B", "B", "B", "B", "B", "B", "B", "O", "O", "B", "B", "B", "B", "B", "B", "B", "B", "B", "B", "W"],
|
||||
["W", "O", "O", "O", "O", "O", 1 , "O", "O", "O", 1 , "O", "O", "O", "O", "O", "O", "O", "O", "O", "W"],
|
||||
["W", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "W"],
|
||||
["W", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "W"],
|
||||
["W", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "W"],
|
||||
["W", "W", 0 , "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "W"],
|
||||
["W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W", "W"]]
|
||||
|
||||
fielddata = {
|
||||
1:"Police Officer", # all_enemies[enemy][0]
|
||||
2:"15313123513210564", # room.id
|
||||
3:"13213543213151321",
|
||||
4:"Angel",
|
||||
"target":4 # you need to kill every angel to finish the mission
|
||||
}
|
||||
|
||||
police = ["Police Officer", "human", "", 0, 0, 0, 0, 0, "glock", "teli", [5, 10], 5]
|
||||
|
||||
all_enemies = {
|
||||
"Police Officer": police,
|
||||
"Private Security": security
|
||||
}
|
||||
|
||||
Mission:
|
||||
success_func() # function to check if mission is accomplished
|
||||
rewardmoney = 200 # integer
|
||||
rewarditems = ["Glock"] # list of Item-objects
|
||||
rewardxp = 25 # integer
|
||||
description = "Kill the boss." # string
|
||||
room = Room() # Room-object where to start
|
||||
current_room = room # Room where the player is
|
||||
rooms = [room, Room(), Room()] # list of Room objects
|
||||
target_item = "Treasure" # string (name of item) - default: None
|
||||
target_enemy = 5 # integer (how many enemies have target attribute) - default: 0
|
||||
target_coordinates = [23,12,15313123513210564] # list (x,y,roomID) - default: None
|
||||
|
||||
|
||||
Player:
|
||||
self.name = name
|
||||
self.race = race
|
||||
self.con = con # Constitution, integer
|
||||
self.str = str # Strength, integer
|
||||
self.agi = agi # Agility, integer
|
||||
self.mob = mob # Mobility, integer
|
||||
self.int = int # Intelligence, integer
|
||||
self.max_hp = self.con * 8 + self.str * 5 + 10 # integer
|
||||
self.id = enemies.getenemyid() # integer
|
||||
self.hp = self.max_hp # integer
|
||||
self.ic = 0 # Initiative Counter, integer
|
||||
self.inventory = [] # List of Objects
|
||||
self.augmentations = [] # List of Strings
|
||||
self.bitcoins = 150 # Integer
|
||||
self.level = 1 # There is no max. level, I think
|
||||
self.experience = 0 # set back to 0 when level increments in levelup()
|
||||
self.gun = items.Gun("No gun", 0, "", 0, 0, 0) # drawn gun
|
||||
self.sword = items.Sword("Fist", 0, "", 50, 0.0, 0.3, 0, False) # drawn sword
|
309
resources/enemies
Normal file
|
@ -0,0 +1,309 @@
|
|||
(dp0
|
||||
S'Vampire'
|
||||
p1
|
||||
(lp2
|
||||
g1
|
||||
aS'vampire'
|
||||
p3
|
||||
aS''
|
||||
p4
|
||||
aI1
|
||||
aI1
|
||||
aI0
|
||||
aI0
|
||||
aI1
|
||||
aS'random'
|
||||
p5
|
||||
ag5
|
||||
a(lp6
|
||||
I10
|
||||
aI15
|
||||
aaI8
|
||||
asS'Terrorist'
|
||||
p7
|
||||
(lp8
|
||||
g7
|
||||
aS'human'
|
||||
p9
|
||||
ag4
|
||||
aI1
|
||||
aI2
|
||||
aI4
|
||||
aI4
|
||||
aI2
|
||||
ag5
|
||||
ag5
|
||||
a(lp10
|
||||
I1
|
||||
aI15
|
||||
aaI7
|
||||
asS'Task Force'
|
||||
p11
|
||||
(lp12
|
||||
S'Task force'
|
||||
p13
|
||||
ag9
|
||||
ag4
|
||||
aI5
|
||||
aI5
|
||||
aI5
|
||||
aI5
|
||||
aI3
|
||||
ag5
|
||||
ag5
|
||||
a(lp14
|
||||
I10
|
||||
aI50
|
||||
aaI10
|
||||
asS'Private Security'
|
||||
p15
|
||||
(lp16
|
||||
S'Private Security'
|
||||
p17
|
||||
ag9
|
||||
ag4
|
||||
aI1
|
||||
aI2
|
||||
aI0
|
||||
aI0
|
||||
aI0
|
||||
ag5
|
||||
aS'teli'
|
||||
p18
|
||||
a(lp19
|
||||
I1
|
||||
aI10
|
||||
aaI6
|
||||
asS'Angel'
|
||||
p20
|
||||
(lp21
|
||||
g20
|
||||
aS'angel'
|
||||
p22
|
||||
ag4
|
||||
aI1
|
||||
aI0
|
||||
aI1
|
||||
aI0
|
||||
aI1
|
||||
ag5
|
||||
ag5
|
||||
a(lp23
|
||||
I10
|
||||
aI15
|
||||
aaI8
|
||||
asS'Soldier'
|
||||
p24
|
||||
(lp25
|
||||
g24
|
||||
ag9
|
||||
ag4
|
||||
aI3
|
||||
aI3
|
||||
aI3
|
||||
aI3
|
||||
aI2
|
||||
ag5
|
||||
aS'knife'
|
||||
p26
|
||||
a(lp27
|
||||
I10
|
||||
aI20
|
||||
aaI8
|
||||
asS'Fascist'
|
||||
p28
|
||||
(lp29
|
||||
g28
|
||||
ag9
|
||||
ag4
|
||||
aI4
|
||||
aI5
|
||||
aI3
|
||||
aI1
|
||||
aI3
|
||||
ag5
|
||||
aS'whip'
|
||||
p30
|
||||
a(lp31
|
||||
I10
|
||||
aI20
|
||||
aaI11
|
||||
asS'Werewolf'
|
||||
p32
|
||||
(lp33
|
||||
g32
|
||||
aS'werewolf'
|
||||
p34
|
||||
ag4
|
||||
aI0
|
||||
aI0
|
||||
aI1
|
||||
aI1
|
||||
aI1
|
||||
ag5
|
||||
aS'krallen'
|
||||
p35
|
||||
a(lp36
|
||||
I10
|
||||
aI15
|
||||
aaI8
|
||||
asS'High Angel'
|
||||
p37
|
||||
(lp38
|
||||
g20
|
||||
ag22
|
||||
ag4
|
||||
aI2
|
||||
aI1
|
||||
aI3
|
||||
aI1
|
||||
aI2
|
||||
ag5
|
||||
ag5
|
||||
a(lp39
|
||||
I15
|
||||
aI25
|
||||
aaI12
|
||||
asS'Police Officer'
|
||||
p40
|
||||
(lp41
|
||||
S'Police Officer'
|
||||
p42
|
||||
ag9
|
||||
ag4
|
||||
aI0
|
||||
aI0
|
||||
aI0
|
||||
aI0
|
||||
aI0
|
||||
aS'glock'
|
||||
p43
|
||||
ag18
|
||||
a(lp44
|
||||
I5
|
||||
aI10
|
||||
aaI5
|
||||
asS'Boss'
|
||||
p45
|
||||
(lp46
|
||||
g45
|
||||
ag9
|
||||
aI7
|
||||
aI6
|
||||
aI6
|
||||
aI7
|
||||
aI0
|
||||
ag5
|
||||
ag5
|
||||
a(lp47
|
||||
I40
|
||||
aI70
|
||||
aaI9
|
||||
asS'Mercenary'
|
||||
p48
|
||||
(lp49
|
||||
g48
|
||||
ag9
|
||||
ag4
|
||||
aI2
|
||||
aI3
|
||||
aI2
|
||||
aI2
|
||||
aI1
|
||||
aS'ak74'
|
||||
p50
|
||||
ag26
|
||||
a(lp51
|
||||
I5
|
||||
aI20
|
||||
aaI7
|
||||
asS'Furious Werewolf'
|
||||
p52
|
||||
(lp53
|
||||
g32
|
||||
ag34
|
||||
ag4
|
||||
aI1
|
||||
aI3
|
||||
aI1
|
||||
aI2
|
||||
aI1
|
||||
ag5
|
||||
aS'silverkrallen'
|
||||
p54
|
||||
a(lp55
|
||||
I15
|
||||
aI25
|
||||
aaI12
|
||||
asS'Besorgt'
|
||||
p56
|
||||
(lp57
|
||||
g56
|
||||
ag9
|
||||
ag4
|
||||
aI0
|
||||
aI0
|
||||
aI0
|
||||
aI0
|
||||
aI0
|
||||
ag5
|
||||
aS'silversword'
|
||||
p58
|
||||
a(lp59
|
||||
I1
|
||||
aI10
|
||||
aaI7
|
||||
asS'Citizen'
|
||||
p60
|
||||
(lp61
|
||||
g60
|
||||
ag9
|
||||
ag4
|
||||
aI0
|
||||
aI0
|
||||
aI0
|
||||
aI0
|
||||
aI0
|
||||
aS'None'
|
||||
p62
|
||||
ag62
|
||||
a(lp63
|
||||
I5
|
||||
aI15
|
||||
aaI0
|
||||
asS'Dark Vampire'
|
||||
p64
|
||||
(lp65
|
||||
g1
|
||||
ag3
|
||||
ag4
|
||||
aI2
|
||||
aI3
|
||||
aI1
|
||||
aI1
|
||||
aI2
|
||||
ag5
|
||||
ag5
|
||||
a(lp66
|
||||
I15
|
||||
aI25
|
||||
aaI12
|
||||
asS'Criminal'
|
||||
p67
|
||||
(lp68
|
||||
S'Criminial'
|
||||
p69
|
||||
ag9
|
||||
ag4
|
||||
aI1
|
||||
aI1
|
||||
aI2
|
||||
aI3
|
||||
aI2
|
||||
ag5
|
||||
ag5
|
||||
a(lp70
|
||||
I1
|
||||
aI15
|
||||
aaI6
|
||||
as.
|
83
resources/guns
Normal file
|
@ -0,0 +1,83 @@
|
|||
(lp0
|
||||
(lp1
|
||||
S'Glock'
|
||||
p2
|
||||
aI30
|
||||
aS'guns/glock.gif'
|
||||
p3
|
||||
aI10
|
||||
aI8
|
||||
aI100
|
||||
aa(lp4
|
||||
S'Uzi'
|
||||
p5
|
||||
aI50
|
||||
aS'guns/uzi.gif'
|
||||
p6
|
||||
aI10
|
||||
aI6
|
||||
aI50
|
||||
aa(lp7
|
||||
S'Kalaschnikow'
|
||||
p8
|
||||
aI80
|
||||
aS'guns/kalaschnikow.gif'
|
||||
p9
|
||||
aI30
|
||||
aI10
|
||||
aI100
|
||||
aa(lp10
|
||||
S'p90 SMG'
|
||||
p11
|
||||
aI60
|
||||
aS'guns/p90.gif'
|
||||
p12
|
||||
aI15
|
||||
aI8
|
||||
aI75
|
||||
aa(lp13
|
||||
S'Sawn-off shotgun'
|
||||
p14
|
||||
aI30
|
||||
aS'guns/sawnoff.gif'
|
||||
p15
|
||||
aI50
|
||||
aI4
|
||||
aI150
|
||||
aa(lp16
|
||||
S'Shotgun'
|
||||
p17
|
||||
aI80
|
||||
aS'guns/shotgun.gif'
|
||||
p18
|
||||
aI70
|
||||
aI6
|
||||
aI150
|
||||
aa(lp19
|
||||
S'Sniper rifle'
|
||||
p20
|
||||
aI140
|
||||
aS'guns/sniper.gif'
|
||||
p21
|
||||
aI90
|
||||
aI15
|
||||
aI175
|
||||
aa(lp22
|
||||
S'M4 Carbine'
|
||||
p23
|
||||
aI110
|
||||
aS'guns/m4carbine.gif'
|
||||
p24
|
||||
aI25
|
||||
aI12
|
||||
aI75
|
||||
aa(lp25
|
||||
S'Light machine gun'
|
||||
p26
|
||||
aI130
|
||||
aS'guns/lmg.gif'
|
||||
p27
|
||||
aI10
|
||||
aI4
|
||||
aI25
|
||||
aa.
|
134
resources/swords
Normal file
|
@ -0,0 +1,134 @@
|
|||
(lp0
|
||||
(lp1
|
||||
S'Baton'
|
||||
p2
|
||||
aI20
|
||||
aS'swords/baton.gif'
|
||||
p3
|
||||
aI75
|
||||
aF0.0
|
||||
aF0.3
|
||||
aI20
|
||||
aI00
|
||||
aa(lp4
|
||||
S'Knife'
|
||||
p5
|
||||
aI20
|
||||
aS'swords/knife.gif'
|
||||
p6
|
||||
aI60
|
||||
aF0.2
|
||||
aF0.0
|
||||
aI30
|
||||
aI00
|
||||
aa(lp7
|
||||
S'Short sword'
|
||||
p8
|
||||
aI40
|
||||
aS'swords/shortsword.gif'
|
||||
p9
|
||||
aI90
|
||||
aF0.3
|
||||
aF0.0
|
||||
aI50
|
||||
aI00
|
||||
aa(lp10
|
||||
S'Long sword'
|
||||
p11
|
||||
aI70
|
||||
aS'swords/longsword.gif'
|
||||
p12
|
||||
aI120
|
||||
aF0.4
|
||||
aF0.1
|
||||
aI70
|
||||
aI00
|
||||
aa(lp13
|
||||
S'Nun-Chakus'
|
||||
p14
|
||||
aI70
|
||||
aS'swords/nunchaku.gif'
|
||||
p15
|
||||
aI80
|
||||
aF0.1
|
||||
aF0.7
|
||||
aI50
|
||||
aI00
|
||||
aa(lp16
|
||||
S'Mace'
|
||||
p17
|
||||
aI70
|
||||
aS'swords/mace.gif'
|
||||
p18
|
||||
aI100
|
||||
aF0.1
|
||||
aF0.5
|
||||
aI70
|
||||
aI00
|
||||
aa(lp19
|
||||
S'Claymore'
|
||||
p20
|
||||
aI120
|
||||
aS'swords/claymore.gif'
|
||||
p21
|
||||
aI150
|
||||
aF0.3
|
||||
aF0.2
|
||||
aI120
|
||||
aI00
|
||||
aa(lp22
|
||||
S'Katana'
|
||||
p23
|
||||
aI100
|
||||
aS'swords/katana.gif'
|
||||
p24
|
||||
aI110
|
||||
aF0.6
|
||||
aF0.1
|
||||
aI75
|
||||
aI00
|
||||
aa(lp25
|
||||
S'Silver dagger'
|
||||
p26
|
||||
aI40
|
||||
aS'swords/silverdagger.gif'
|
||||
p27
|
||||
aI60
|
||||
aF0.2
|
||||
aF0.0
|
||||
aI30
|
||||
aI01
|
||||
aa(lp28
|
||||
S'Silver sword'
|
||||
p29
|
||||
aI90
|
||||
aS'swords/silversword.gif'
|
||||
p30
|
||||
aI120
|
||||
aF0.3
|
||||
aF0.2
|
||||
aI50
|
||||
aI01
|
||||
aa(lp31
|
||||
S'Silberkrallen'
|
||||
p32
|
||||
aI30
|
||||
aS'swords/silverclaws.gif'
|
||||
p33
|
||||
aI50
|
||||
aF0.4
|
||||
aF0.7
|
||||
aI150
|
||||
aI01
|
||||
aa(lp34
|
||||
S'Silver whip'
|
||||
p35
|
||||
aI60
|
||||
aS'swords/whip.gif'
|
||||
p36
|
||||
aI150
|
||||
aF0.7
|
||||
aF0.8
|
||||
aI30
|
||||
aI01
|
||||
aa.
|