1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- namespace loyalsoft;
- /**
- * Description of Ins_Equip
- *
- * @author c'y'zhao
- */
- class Ins_Pet extends Object_ext{
-
- /**
- * 实例唯一编号
- */
- public $uid = 0;
-
- /*
- * 模板数据编号
- */
- public $typeId = 0;
-
- /*
- * 等级
- */
- public $level = 1;
-
- /**
- * 品质
- * @var type
- */
- public $qual;
- /**
- * 是否是新得到的 1:是的
- * @var type
- */
- public $isNew = 1;
- /**
- * 构造函数
- * @param type $args
- */
- public function __construct($args = null) {
- if($args !=null){
- parent::__construct($args);
- } else {
- }
- }
-
- /**
- * 配置
- * @return sm_pet
- */
- public function mo() {
- $mo = GameConfig::pet_getItem($this->typeId);
- my_Assert(null != $mo, ErrCode::err_const_no);
- return $mo;
- }
-
- public function petLevelMo() {
- $mo = GameConfig::pet_levelupgrade_getItem($this->mo()->rarity, $this->qual,$this->level);
- my_Assert(null != $mo, ErrCode::err_const_no);
- return $mo;
- }
-
-
- /*
- * 装备最大等级
- */
- public function Pet_MaxLevel() {
- $rarity = $this->mo()->rarity;
- $qual = $this->qual;
- $dic = GameConfig::pet_levelupgrade();
- $max = 0;
- foreach ($dic as $str => $mo) {
- if($mo->rarity == $rarity && $mo->qual == $qual){
- if($mo->level > $max){
- $max = $mo->level;
- }
- }
- }
- return $max;
- }
-
- }
|