卡牌技能
This commit is contained in:
@@ -52,7 +52,7 @@ export class MonsterViewComp extends CCComp {
|
||||
speed: number = 100; /** 角色移动速度 */
|
||||
ospeed: number = 100; /** 角色初始速度 */
|
||||
Tpos: Vec3 = v3(0,-60,0);
|
||||
stop_cd: number = 0; /*停止倒计时*/
|
||||
stop_cd: number = 0.5; /*停止倒计时*/
|
||||
|
||||
shield:number = 0; //护盾量
|
||||
shield_time:number = 0; //护盾持续时间
|
||||
@@ -139,12 +139,15 @@ export class MonsterViewComp extends CCComp {
|
||||
}
|
||||
|
||||
move(dt: number){
|
||||
if(this.stop_cd > 0){
|
||||
return
|
||||
}
|
||||
/**
|
||||
* 根据角色的阵营检查角色的 x 轴位置是否满足特定条件。
|
||||
* 如果角色属于正向阵营 (camp == 1) 且 x 轴位置大于等于 0,则直接返回。
|
||||
* 如果角色属于反向阵营 (camp != 1) 且 x 轴位置小于等于 0,则直接返回。
|
||||
*/
|
||||
if ((this.camp === 1 && this.node.position.x >= 180) || (this.camp !== 1 && this.node.position.x <= -180)) {
|
||||
if ((this.camp === 1 && this.node.position.x >= 0) || (this.camp !== 1 && this.node.position.x <= -180)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -191,7 +194,7 @@ export class MonsterViewComp extends CCComp {
|
||||
if(this.stop_cd > 0){
|
||||
this.stop_cd -= dt;
|
||||
if(this.stop_cd <= 0){
|
||||
this.speed = this.ospeed;
|
||||
// this.speed = this.ospeed;
|
||||
this.stop_cd = 0;
|
||||
}
|
||||
}
|
||||
@@ -223,7 +226,7 @@ export class MonsterViewComp extends CCComp {
|
||||
let pos = v3(this.camp*30,30)
|
||||
let speed =400
|
||||
let scale = this.camp
|
||||
let range = 360;
|
||||
let range = 120;
|
||||
skill.load(pos,speed,range,scale,this.node,skill_name,this.atk);
|
||||
}
|
||||
in_atked() {
|
||||
|
||||
Reference in New Issue
Block a user