|
@@ -159,10 +159,15 @@ class Info_UserBase extends Object_ext {
|
|
|
* 用户获得金币
|
|
|
* @param int $amt
|
|
|
*/
|
|
|
- function Add_Gold($amt) {
|
|
|
+ function Add_Gold($amt,$mask = 0) {
|
|
|
my_Assert($amt >= 0, "参数为负");
|
|
|
|
|
|
- UserProc::CollectUserBaseParam(req()->cmd,2, $this->gold, $amt, $this->gold+$amt, "获得金币");
|
|
|
+ if($mask == 1){
|
|
|
+ UserProc::CollectUserBaseParam(req()->cmd,2, $this->gold, $amt, $this->gold+$amt, "关卡战斗掉落金币");
|
|
|
+ } else {
|
|
|
+ UserProc::CollectUserBaseParam(req()->cmd,2, $this->gold, $amt, $this->gold+$amt, "获得金币");
|
|
|
+ }
|
|
|
+
|
|
|
$this->gold += $amt;
|
|
|
}
|
|
|
|
|
@@ -171,7 +176,7 @@ class Info_UserBase extends Object_ext {
|
|
|
* @param int $amt
|
|
|
* @return boolean true:成功, false:金币不足
|
|
|
*/
|
|
|
- function Consume_Gold($amt) {
|
|
|
+ function Consume_Gold($amt,$mask = 0) {
|
|
|
if ($amt > 0) {
|
|
|
if ($this->gold - $amt >= 0) {
|
|
|
UserProc::CollectUserBaseParam(req()->cmd,2, $this->gold, $amt, $this->gold-$amt, "消耗金币");
|
|
@@ -186,10 +191,15 @@ class Info_UserBase extends Object_ext {
|
|
|
* 增加用户钻石
|
|
|
* @param type $amt
|
|
|
*/
|
|
|
- function Add_Cash($amt) {
|
|
|
+ function Add_Cash($amt,$mask = 0) {
|
|
|
my_Assert($amt >= 0, "amt值为负");
|
|
|
|
|
|
- UserProc::CollectUserBaseParam(req()->cmd, 3, $this->cash, $amt, $this->cash+$amt,"获得钻石");
|
|
|
+ if($mask == 1){
|
|
|
+ UserProc::CollectUserBaseParam(req()->cmd, 3, $this->cash, $amt, $this->cash+$amt,"关卡战斗掉落钻石");
|
|
|
+ } else {
|
|
|
+ UserProc::CollectUserBaseParam(req()->cmd, 3, $this->cash, $amt, $this->cash+$amt,"获得钻石");
|
|
|
+ }
|
|
|
+
|
|
|
$this->cash += $amt;
|
|
|
}
|
|
|
|
|
@@ -198,7 +208,7 @@ class Info_UserBase extends Object_ext {
|
|
|
* @param int $amt
|
|
|
* @return bool 成功与否
|
|
|
*/
|
|
|
- function Consume_Cash($amt) {
|
|
|
+ function Consume_Cash($amt,$mask = 0) {
|
|
|
if ($amt >= 0) {
|
|
|
if ($this->cash - $amt >= 0) {
|
|
|
UserProc::CollectUserBaseParam(req()->cmd, 3, $this->cash, $amt, $this->cash-$amt,"消耗钻石");
|