|
@@ -113,7 +113,7 @@ class Info_UserBase extends Object_ext {
|
|
$this->gold = glc()->Init_Player_gold;
|
|
$this->gold = glc()->Init_Player_gold;
|
|
$this->cash = glc()->Init_Player_cash;
|
|
$this->cash = glc()->Init_Player_cash;
|
|
$this->xp = 0;
|
|
$this->xp = 0;
|
|
-
|
|
|
|
|
|
+
|
|
$this->maxXp = GameConfig::player_level_getItem(2)->xp_need;
|
|
$this->maxXp = GameConfig::player_level_getItem(2)->xp_need;
|
|
|
|
|
|
$this->level = 1;
|
|
$this->level = 1;
|
|
@@ -134,7 +134,7 @@ class Info_UserBase extends Object_ext {
|
|
*/
|
|
*/
|
|
function Add_tili($amt) {
|
|
function Add_tili($amt) {
|
|
my_Assert($amt >= 0, "体力amt小于0");
|
|
my_Assert($amt >= 0, "体力amt小于0");
|
|
- //ActiveProc::ChangeTili($amt);
|
|
|
|
|
|
+ //ActiveProc::ChangeTili($amt);
|
|
for ($i = 0; $i < $amt; $i++) {
|
|
for ($i = 0; $i < $amt; $i++) {
|
|
if ((now() - $this->tili_ts) / glc()->tili_RecoverTS < $this->GetTili_RecoverrMax()) {
|
|
if ((now() - $this->tili_ts) / glc()->tili_RecoverTS < $this->GetTili_RecoverrMax()) {
|
|
$this->tili_ts -= glc()->tili_RecoverTS;
|
|
$this->tili_ts -= glc()->tili_RecoverTS;
|
|
@@ -143,17 +143,17 @@ class Info_UserBase extends Object_ext {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
- * 体力恢复的最大值(购买或者邮件领取的可以超出,超出后体力恢复失效)
|
|
|
|
|
|
+ * 体力恢复的最大值(购买或者邮件领取的可以超出,超出后体力恢复失效)
|
|
*/
|
|
*/
|
|
function GetTili_RecoverrMax() {
|
|
function GetTili_RecoverrMax() {
|
|
$maxTili = glc()->tili_RecoverrMax;
|
|
$maxTili = glc()->tili_RecoverrMax;
|
|
$monthTs = 30 * 24 * 60 * 60;
|
|
$monthTs = 30 * 24 * 60 * 60;
|
|
- if(ctx()->privateState->honourCardShop_ts > 0 && now() - ctx()->privateState->honourCardShop_ts < $monthTs){
|
|
|
|
|
|
+ if (ctx()->privateState->honourCardShop_ts > 0 && now() - ctx()->privateState->honourCardShop_ts < $monthTs) {
|
|
$maxTili += glc()->tili_RecoverrMax_Add_HonourCard;
|
|
$maxTili += glc()->tili_RecoverrMax_Add_HonourCard;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
return $maxTili;
|
|
return $maxTili;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -174,7 +174,7 @@ class Info_UserBase extends Object_ext {
|
|
* @return bool 成功与否
|
|
* @return bool 成功与否
|
|
*/
|
|
*/
|
|
function Consume_tili($amt) {
|
|
function Consume_tili($amt) {
|
|
- if ($amt >= 0) {
|
|
|
|
|
|
+ if ($amt >= 0) {
|
|
TaskProc::OnAccumulateTiliNum($amt);
|
|
TaskProc::OnAccumulateTiliNum($amt);
|
|
$cpt = glc()->tili_RecoverTS;
|
|
$cpt = glc()->tili_RecoverTS;
|
|
if ($this->tili > 0) {
|
|
if ($this->tili > 0) {
|
|
@@ -199,7 +199,7 @@ class Info_UserBase extends Object_ext {
|
|
* @return int 计算当前可用体力值
|
|
* @return int 计算当前可用体力值
|
|
*/
|
|
*/
|
|
function CurTili() {
|
|
function CurTili() {
|
|
- $maxTili = $this->GetTili_RecoverrMax();
|
|
|
|
|
|
+ $maxTili = $this->GetTili_RecoverrMax();
|
|
$rec = (now() - $this->tili_ts) / glc()->tili_RecoverTS;
|
|
$rec = (now() - $this->tili_ts) / glc()->tili_RecoverTS;
|
|
$rec = $maxTili < $rec ? $maxTili : $rec;
|
|
$rec = $maxTili < $rec ? $maxTili : $rec;
|
|
$t = $this->tili + $rec;
|
|
$t = $this->tili + $rec;
|
|
@@ -253,7 +253,7 @@ class Info_UserBase extends Object_ext {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -271,15 +271,15 @@ class Info_UserBase extends Object_ext {
|
|
while ($this->xp >= $cfgLVs->$nextLevel->xp_need) { # 超过升级所需经验
|
|
while ($this->xp >= $cfgLVs->$nextLevel->xp_need) { # 超过升级所需经验
|
|
if ($this->level < glc()->Game_MaxPlayerLevel) { # 如果未到达最大等级
|
|
if ($this->level < glc()->Game_MaxPlayerLevel) { # 如果未到达最大等级
|
|
StoreProc::AddMultiItemInStore(GameConfig::player_level_getItem($this->level)->reward, Enum_StoreSourceType::AddExp);
|
|
StoreProc::AddMultiItemInStore(GameConfig::player_level_getItem($this->level)->reward, Enum_StoreSourceType::AddExp);
|
|
- $this->level++;
|
|
|
|
|
|
+ $this->level++;
|
|
$this->xp -= $cfgLVs->$nextLevel->xp_need;
|
|
$this->xp -= $cfgLVs->$nextLevel->xp_need;
|
|
$curLevel = $this->level;
|
|
$curLevel = $this->level;
|
|
- $nextLevel = $curLevel + 1;
|
|
|
|
|
|
+ $nextLevel = $curLevel + 1;
|
|
my_Assert(CommUtil::isPropertyExists($cfgLVs, $nextLevel), ErrCode::err_const_no); // "取英雄升级常量数据失败." . $nextLevel . "级");
|
|
my_Assert(CommUtil::isPropertyExists($cfgLVs, $nextLevel), ErrCode::err_const_no); // "取英雄升级常量数据失败." . $nextLevel . "级");
|
|
$this->maxXp = $cfgLVs->$nextLevel->xp_need;
|
|
$this->maxXp = $cfgLVs->$nextLevel->xp_need;
|
|
-
|
|
|
|
|
|
+
|
|
TaskProc::OnUserLevel_X($this->level);
|
|
TaskProc::OnUserLevel_X($this->level);
|
|
-
|
|
|
|
|
|
+ FightProc::skillUnlock_userLevel($this->level); # 等级解锁技能
|
|
// StatProc::UserLevel($nowlv); # 等级统计
|
|
// StatProc::UserLevel($nowlv); # 等级统计
|
|
} else { # 如果已到达最大等级则仅补齐缺失的经验即可
|
|
} else { # 如果已到达最大等级则仅补齐缺失的经验即可
|
|
$this->xp = $this->maxXp; # 经验不能超过最大值
|
|
$this->xp = $this->maxXp; # 经验不能超过最大值
|