1
This commit is contained in:
parent
57ccf77ce5
commit
3a774c7c13
@ -261,9 +261,9 @@ class Gun extends BaseModel {
|
|||||||
public static function gainGold($gunDto, $addGold)
|
public static function gainGold($gunDto, $addGold)
|
||||||
{
|
{
|
||||||
$finalyAddGold = 0;
|
$finalyAddGold = 0;
|
||||||
$goldLimit = 0;
|
|
||||||
$gunQualityMeta = mt\GunQuality::getByQuality($gunDto['quality']);
|
$gunQualityMeta = mt\GunQuality::getByQuality($gunDto['quality']);
|
||||||
if ($gunQualityMeta) {
|
if ($gunQualityMeta) {
|
||||||
|
$goldLimit = $gunQualityMeta['gold_limit'];
|
||||||
$attr = mt\AttrHelper::getAbsVal($gunDto['attr'], kHAT_LUCKY);
|
$attr = mt\AttrHelper::getAbsVal($gunDto['attr'], kHAT_LUCKY);
|
||||||
if ($attr) {
|
if ($attr) {
|
||||||
$goldLimit += $attr['val'];
|
$goldLimit += $attr['val'];
|
||||||
|
@ -309,9 +309,9 @@ class Hero extends BaseModel {
|
|||||||
public static function gainGold($heroDto, $addGold)
|
public static function gainGold($heroDto, $addGold)
|
||||||
{
|
{
|
||||||
$finalyAddGold = 0;
|
$finalyAddGold = 0;
|
||||||
$goldLimit = 0;
|
|
||||||
$heroQualityMeta = mt\HeroQuality::getByQuality($heroDto['quality']);
|
$heroQualityMeta = mt\HeroQuality::getByQuality($heroDto['quality']);
|
||||||
if ($heroQualityMeta) {
|
if ($heroQualityMeta) {
|
||||||
|
$goldLimit = $heroQualityMeta['gold_limit'];
|
||||||
$attr = mt\AttrHelper::getAbsVal($heroDto['attr'], kHAT_LUCKY);
|
$attr = mt\AttrHelper::getAbsVal($heroDto['attr'], kHAT_LUCKY);
|
||||||
if ($attr) {
|
if ($attr) {
|
||||||
$goldLimit += $attr['val'];
|
$goldLimit += $attr['val'];
|
||||||
|
@ -365,7 +365,7 @@ class BattleDataService extends BaseService {
|
|||||||
$weaponUniid = getReqVal('weapon_uuid' . $i, 0);
|
$weaponUniid = getReqVal('weapon_uuid' . $i, 0);
|
||||||
if ($weaponUniid) {
|
if ($weaponUniid) {
|
||||||
$row = Gun::find($weaponUniid);
|
$row = Gun::find($weaponUniid);
|
||||||
$gunDto = $gunDb ? Gun::toDto($row) : null;
|
$gunDto = $row ? Gun::toDto($row) : null;
|
||||||
if ($gunDto){
|
if ($gunDto){
|
||||||
$finalyAddGold += Gun::gainGold($gunDto, $addGold);
|
$finalyAddGold += Gun::gainGold($gunDto, $addGold);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user