xx 1 gadu atpakaļ
vecāks
revīzija
bc38cd33c7
1 mainītis faili ar 7 papildinājumiem un 4 dzēšanām
  1. 7 4
      assets/script/game/car.ts

+ 7 - 4
assets/script/game/car.ts

@@ -4,7 +4,7 @@ import { box } from './box';
 import { coin } from './coin';
 import { tools } from '../tools';
 import { game } from './game';
-import { DirType, model_content_item_data } from '../data';
+import { car_item_data, DirType, model_content_item_data } from '../data';
 import { config } from '../config';
 import { imageCacheManager } from '../manager/imageCacheManager';
 import { userDataManager } from '../manager/userDataManager';
@@ -13,6 +13,7 @@ import { buff_manager } from './buff/buff_manager';
 import { hp_bar } from './hp_bar';
 import { GameManager } from '../GameManager';
 import { buff_active_effect_item } from './buff/buff_active_effect_item';
+import { dataManager } from '../manager/dataManager';
 const { ccclass, property } = _decorator;
 
 @ccclass('car')
@@ -49,6 +50,7 @@ export class car extends Component {
     @property(Prefab) buff_active_effect_pf:Prefab = null
     @property(ParticleSystem2D) smoke_particle:ParticleSystem2D = null
     private mIsReLife:boolean = false
+    private mCarData:car_item_data = null
     public init(m:Node,cb,cb1,g:game,isReLife:boolean = false){
         this.mIsReLife = isReLife
         this.spr.getComponent(Sprite).spriteFrame = imageCacheManager.getGameCarImageById(userDataManager.user_car_list.default_car_id)
@@ -71,6 +73,7 @@ export class car extends Component {
             audioManager.Instance().playSound(config.AUDIO.car_qi_dong)
         }
      
+        this.mCarData = dataManager.getUserCarInfo(userDataManager.user_car_list.default_car_id)
         // let cd = this.node.getComponent(BoxCollider2D)
         // cd.off(Contact2DType.BEGIN_CONTACT)
         // cd.on(Contact2DType.BEGIN_CONTACT,this.onColliderCoin.bind(this))
@@ -100,7 +103,7 @@ export class car extends Component {
         //     }
         // },this)
         this.move_speed_y = tools.game_config.car_origin_speed
-        this.hp = tools.game_config.car_init_num
+        this.hp = tools.game_config.car_init_num + this.mCarData.attribute.k_oil_number
         this.hp_bar.getComponent(hp_bar).updateHp(this.hp)
         // this.hp = 100000
         if(isReLife){
@@ -312,7 +315,7 @@ export class car extends Component {
     }
 
     public buff_xing(){
-        this.addSpeedNum(tools.game_config.buff_xi_add_speed)
+        this.addSpeedNum(tools.game_config.buff_xi_add_speed+this.mCarData.attribute.n_star_cd)
         // Tween.stopAllByTarget(this.game_manager.getBuffShowView().getBuffXing())
         // this.cancelScheduleBuffXing()
         // tween(this.game_manager.getBuffShowView().getBuffXing()).delay(tools.game_config.buff_xing).call(this.cancelScheduleBuffXing.bind(this)).start()
@@ -332,7 +335,7 @@ export class car extends Component {
     }
 
     public buff_dun(){
-        this.addSpeedNum(tools.game_config.buff_dun_add_speed)
+        this.addSpeedNum(tools.game_config.buff_dun_add_speed+this.mCarData.attribute.n_shield_cd)
         // Tween.stopAllByTarget(this.game_manager.getBuffShowView().getBuffDun())
         // this.cancelScheduleBuffDun()
         // tween(this.game_manager.getBuffShowView().getBuffDun()).delay(tools.game_config.buff_dun).call(this.cancelScheduleBuffDun.bind(this)).start()