1 Star 2 Fork 0

Trister/卡牌类游戏

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
player.py 2.77 KB
一键复制 编辑 原始数据 按行查看 历史
Trister 提交于 2018-11-21 16:11 . 初步完成
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/10/31 12:19
# @Author : Triste_hui
from game_db import *
class Combat(object): # 战斗用
def __init__(self):
self.name = "" # 名字
self.hp = 0 # 生命
self.atk = 0 # 攻击
self.defe = 0 # 防御
self.lv = 0 # 等级
class Equip(object): # 装备
def __init__(self, name="", id=0, quality=0, lv=0, atk=0, defe=0, hp=0, side=0):
self.name = name # 装备名
self.id = id # 装备id
self.quality = quality # 装备品质,1白2绿3蓝4紫5橙6史诗
self.lv = lv # 装备级别
self.atk = atk # 装备带来的攻击力
self.defe = defe # 装备带来的防御
self.hp = hp # 装备带来的生命值
self.side = side # 装备位置
def set(self, i, l): # 根据ID和级别初始化装备
pass
def buyEq(self, i): # 根据ID购买装备
pass
def getATK(self): # 返回攻击力
pass
def getDEF(self): # 返回防御力
pass
def getHP(self):
pass
def getSIDE(self):
pass
def getLV(self):
pass
def getQU(self):
pass
def getNAME(self):
pass
def setSIDE(self, s): # 设置装备位置,移出卡牌的装备时使用
pass
def show(self): # 显示装备属性
pass
def getLVLimit(self): # 装备级别限制
pass
def operator(self, i):
pass
def isHere(self): # 装备是否存在
pass
class Player(object): # 玩家
def __init__(self):
self.id = None
self.name = None
self.card = None
self.cardbk = None
self.gold = None
self.diamond = None
self.lv = None
self.stars = None
self.eqbank = None
self.map = None
def getGold(self):
return self.gold
def getDiamond(self):
return self.diamond
def getLV(self):
return self.lv
def getStars(self):
return self.stars
def getMAP(self):
return self.map
def getName(self):
return self.name
def addMAP(self, m):
self.map = m
def addGold(self, g):
self.gold += g
def addDiamond(self, d):
self.diamond += d
def addLV(self):
self.lv += 1
def addStars(self, s):
self.stars += s
def save(self):
pass
def load(self, **result):
self.id = result.get('id')
self.name = result.get('name')
self.gold = result.get('gold')
self.diamond = result.get('diamond')
self.lv = result.get('lv')
self.card = result.get('card')
def create(self):
pass
def show(self):
pass
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/Trister/card_games.git
git@gitee.com:Trister/card_games.git
Trister
card_games
卡牌类游戏
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385