#!/usr/bin/python
|
# -*- coding: GBK -*-
|
|
##@package MakeMoney
|
# ÖÆÔìÇ®±Ò<Ç®±ÒÀàÐÍ><ÊýÁ¿>
|
#
|
# @author kill
|
# @date 2010-4-23
|
# @version 1.1
|
#
|
# ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
|
# VER = "2010-05-12 18:30" zhengyang Ìí¼Ó×¢ÊÍ
|
# @change: "2016-07-20 14:30" hxp ͳһº¯Êý
|
#
|
# Ä£¿éÏêϸ˵Ã÷
|
|
import Lang
|
import PlayerControl
|
import ShareDefine
|
import ChConfig
|
import GameWorld
|
|
moneyNameDict = ShareDefine.MoneyNameDict
|
|
## GMÃüÁîÖ´ÐÐÈë¿Ú
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param list ²ÎÊýÁбí [ <Ç®±ÒÀàÐÍ><ÊýÁ¿>]
|
# @return None
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def OnExec(curPlayer,List):
|
if len(List) != 2:
|
#²ÎÊý²»ÕýÈ·
|
GameWorld.DebugAnswer(curPlayer, Lang.GBText("²ÎÊý²»ÕýÈ·"))
|
return
|
#Ç®±ÒÀàÐÍ
|
moneyType = List[0]
|
#Ç®±ÒÊýÁ¿
|
moneyCount = List[1]
|
#ÊäÈëÀàÐͲ»¶ÔÌáʾǮ±ÒÀàÐÍ´í
|
if type(moneyType) != int or type(moneyCount) not in [int, long] :
|
GameWorld.DebugAnswer(curPlayer, Lang.GBText("²ÎÊý²»ÕýÈ·"))
|
return
|
#Ç®±ÒÀàÐÍ·¶Î§
|
if moneyType not in [1, 2, 3, 4] and moneyType not in ShareDefine.MoneyNameDict:
|
GameWorld.DebugAnswer(curPlayer, Lang.GBText("Ç®±ÒÀàÐͲ»ÕýÈ·"))
|
return
|
|
#0ÎIJ»´¦Àí
|
if moneyCount <= 0 :
|
return
|
PlayerControl.GiveMoney(curPlayer, moneyType, moneyCount, ChConfig.Def_GiveMoney_GM, {ChConfig.Def_Give_Reason_SonKey:"MakeMoney"})
|
GameWorld.DebugAnswer(curPlayer, "»õ±Ò%s%s=%s" % (moneyType, moneyNameDict.get(moneyType, moneyType), PlayerControl.GetMoneyReal(curPlayer, moneyType)))
|
return
|
|
|
|