This commit is contained in:
walkpan
2025-01-02 00:00:05 +08:00
parent 1df06c791f
commit fdec4ef47b
68 changed files with 63931 additions and 22650 deletions

View File

@@ -24,6 +24,11 @@ export class BuffComp extends Component {
dedef_cd:number=0;
dehp_cd:number=0;
decrit_cd:number=0;
iced_cd:number=0;
buff_cd:number=0;
yun_cd:number=0;
wind_cd:number=0;
speek_time:number=0;
start() {
@@ -97,6 +102,26 @@ export class BuffComp extends Component {
}
if(this.wind_cd > 0 ) this.wind_cd -= deltaTime;
if(this.wind_cd <= 0 && this.node.getChildByName("wind").active){
this.node.getChildByName("wind").active = false;
}
if(this.yun_cd > 0 ) this.yun_cd -= deltaTime;
if(this.yun_cd <= 0 && this.node.getChildByName("yun").active){
this.node.getChildByName("yun").active = false;
}
if(this.iced_cd > 0 ) this.iced_cd -= deltaTime;
if(this.iced_cd <= 0 && this.node.getChildByName("iced").active){
this.node.getChildByName("iced").active = false;
}
if(this.buff_cd > 0 ) this.buff_cd -= deltaTime;
if(this.buff_cd <= 0 && this.node.getChildByName("buff").active){
this.node.getChildByName("buff").active = false;
}
this.hp_show()
this.in_speek(deltaTime)
@@ -123,7 +148,6 @@ export class BuffComp extends Component {
show_hp(t:number=2){
this.hp_cd = t;
this.node.getChildByName("top").getChildByName("buff").getChildByName("hp").active = true;
}
show_crit(t:number=2){
this.crit_cd = t;
@@ -145,13 +169,32 @@ export class BuffComp extends Component {
show_debuff_hp(t:number=2){
this.dehp_cd = t;
this.node.getChildByName("top").getChildByName("buff").getChildByName("hp").active = true;
}
show_debuff_crit(t:number=2){
this.decrit_cd = t;
this.node.getChildByName("top").getChildByName("buff").getChildByName("crit").active = true;
}
show_iced(t:number=1){
this.iced_cd = t;
this.node.getChildByName("iced").active = true;
}
show_yun(t:number=1){
this.iced_cd = t;
this.node.getChildByName("yun").active = true;
}
show_wind(t:number=1){
this.wind_cd = t;
this.node.getChildByName("wind").active = true;
}
show_buff(t:number=1){
this.buff_cd = t;
this.node.getChildByName("buff").active = true;
}
hp_show(){
let hp_progress= this.heroView.hp/this.heroView.rhp_max;
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
@@ -161,6 +204,12 @@ export class BuffComp extends Component {
this.node.getChildByName("top").getChildByName("hp").active = true;
}
}
max_show(){
this.node.getChildByName("max").active=true
this.scheduleOnce(()=>{
this.node.getChildByName("max").active=false
},0.8)
}
dead(){
var path = "game/skills/dead";
var prefab: Prefab = oops.res.get(path, Prefab)!;
@@ -178,7 +227,7 @@ export class BuffComp extends Component {
node.parent = this.node;
}
to_speek(words:string,time:number=0.5){
to_speek(words:string,time:number=0.5){
this.speek_time=0.5
this.node.getChildByName("tooltip").active=true
this.node.getChildByName("tooltip").getChildByName("words").getComponent(Label)!.string = words

View File

@@ -1,8 +1,9 @@
import { _decorator, Component, Label, Node, resources, Sprite, SpriteAtlas } from 'cc';
import { _decorator, Color, Component, Label, Node, resources, Sprite, SpriteAtlas } from 'cc';
import { HeroInfo } from '../common/config/heroSet';
import { oops } from '../../../../extensions/oops-plugin-framework/assets/core/Oops';
import { UIID } from '../common/config/GameUIConfig';
import { Items } from '../common/config/Items';
import { ColorSet } from '../common/config/BoxSet';
const { ccclass, property } = _decorator;
@ccclass('HChipComp')
@@ -34,6 +35,17 @@ export class HChipComp extends Component {
}else{
this.node.getChildByName("num").getComponent(Label).string = "";
}
switch(HeroInfo[uuid].quality){
case 1:
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["BLUE"]);
break;
case 2:
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["YELLOW"]);
break;
case 3:
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["RED"]);
break;
}
}
}

View File

@@ -1,9 +1,11 @@
import { _decorator, Label } from "cc";
import { _decorator, Color, Label, Sprite } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { HeroHomeComp } from "../map/HeroHomeComp";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { smc } from "../common/SingletonModuleComp";
import { HeroInfo } from "../common/config/heroSet";
import { ColorSet } from "../common/config/BoxSet";
const { ccclass, property } = _decorator;
@@ -38,6 +40,7 @@ export class HeroCardComp extends CCComp {
this.node.getChildByName("show").active=val
}
update_data(){
let slv = this.node.getChildByName("slv")
this.node.getChildByName("lv").getComponent(Label).string=smc.heros[this.h_uuid].lv.toString()+"级"
if(smc.heros[this.h_uuid].slv==0){
@@ -48,7 +51,17 @@ export class HeroCardComp extends CCComp {
this.node.getChildByName("lock").active=false
slv.getChildByName("slv").getComponent(Label).string=smc.heros[this.h_uuid].slv.toString()
}
switch(HeroInfo[this.h_uuid].quality){
case 1:
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["BLUE"]);
break;
case 2:
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["YELLOW"]);
break;
case 3:
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["RED"]);
break;
}
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {

View File

@@ -1,10 +1,11 @@
import { _decorator, Label } from "cc";
import { _decorator, Color, Label, Sprite } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { MissionHomeComp } from "../map/MissionHomeComp";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { smc } from "../common/SingletonModuleComp";
import { GameSet } from "../common/config/BoxSet";
import { ColorSet, GameSet } from "../common/config/BoxSet";
import { HeroInfo } from "../common/config/heroSet";
const { ccclass, property } = _decorator;
@@ -62,6 +63,17 @@ export class HeroSelectComp extends CCComp {
slv.active=true
slv.getChildByName("slv").getComponent(Label).string=smc.heros[this.h_uuid].slv.toString()
}
switch(HeroInfo[this.h_uuid].quality){
case 1:
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["BLUE"]);
break;
case 2:
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["YELLOW"]);
break;
case 3:
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["RED"]);
break;
}
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {

View File

@@ -123,8 +123,6 @@ export class HeroViewComp extends CCComp {
onLoad() {
this.as = this.getComponent(HeroSpine);
// this.BoxRang = this.node.getChildByName("range_box");
// this.BoxRang = this.node.getChildByName("range_box");
} /** 视图层逻辑代码分离演示 */
@@ -138,7 +136,7 @@ export class HeroViewComp extends CCComp {
this.node.getChildByName("top").setScale(this.scale,1);
/** 显示角色血量 */
this.node.getChildByName("top").getChildByName("hp").active = true;
// this.node.getChildByName("shielded").active = false;
// this.node.getChildByName("top").setScale(this.scale,1);
// this.node.getChildByName("atk").setScale(this.scale,1);
@@ -186,13 +184,13 @@ export class HeroViewComp extends CCComp {
if(selfCollider.group == otherCollider.group&&selfCollider.tag==otherCollider.tag){
if(selfCollider.group==BoxSet.HERO){
if(otherCollider.node.getComponent(HeroViewComp).type == this.type && self_x < other_x && Math.abs(other_x-self_x) < 20 ){
if(otherCollider.node.getComponent(HeroViewComp).type == this.type && self_x < other_x && Math.abs(other_x-self_x) < 50 ){
// this.node.setSiblingIndex(otherCollider.node.getSiblingIndex()-10)
this.stop_cd = 0.1;
}
}
if(selfCollider.group==BoxSet.MONSTER){
if(otherCollider.node.getComponent(HeroViewComp).type == this.type && self_x > other_x && Math.abs(other_x-self_x) < 20 ){
if(otherCollider.node.getComponent(HeroViewComp).type == this.type && self_x > other_x && Math.abs(other_x-self_x) < 50 ){
// this.node.setSiblingIndex(otherCollider.node.getSiblingIndex()-10)
this.stop_cd = 0.1;
}
@@ -221,7 +219,7 @@ export class HeroViewComp extends CCComp {
this.check_power()
this.check_atk_counts()
this.check_enemy_alive()
this.check_mission_buf()
this.check_mission_buff()
if(this.ice_cd > 0){ this.ice_cd -=dt; return }
if(this.yun_cd > 0){ this.yun_cd -=dt; return }
@@ -231,18 +229,8 @@ export class HeroViewComp extends CCComp {
this.in_atk(dt);
this.move(dt);
}
check_iceed(dt:number){
if(this.ice_cd > 0){
this.ice_cd -= dt;
if(this.ice_cd <= 0){
this.ice_cd = 0;
}
}
}
check_yuned(dt:number){
}
check_mission_buf(){
check_mission_buff(){
this.ap_max=(100+smc.vmdata.mission.ap)/100*this.ap
this.crit_max=(100+smc.vmdata.mission.crit)/100*this.crit
this.def_max=(100+smc.vmdata.mission.def)/100*this.def
@@ -282,22 +270,6 @@ export class HeroViewComp extends CCComp {
this.is_atking=false
}
}
//进入墓地
to_grave(){
let pos =v3(-999,this.node.position.y)
if(this.box_group == BoxSet.MONSTER){
pos =v3(999,this.node.position.y)
smc.vmdata.mission.mdead +=1
}else{
smc.vmdata.mission.dead +=1
}
this.node.setPosition(pos)
}
//是否在墓地
in_grave(){
return this.node.position.x < -900 || this.node.position.x > 900;
}
//状态切换
status_change(type:string){
this.status=type
@@ -378,10 +350,8 @@ export class HeroViewComp extends CCComp {
check_power(){
if(this.pw >= this.pwm){
this.pw = 0
this.node.getChildByName("max").active=true
this.scheduleOnce(()=>{
this.node.getChildByName("max").active=false
},0.8)
this.BUFFCOMP.max_show()
this.handle_skill(this.sk2)
return true
}else{
@@ -443,10 +413,7 @@ export class HeroViewComp extends CCComp {
// console.log("攻击判断: i="+i+":akr="+this.akr);
if(i < this.akr){
// console.log("攻击触发: i="+i+":akr="+this.akr);
this.node.getChildByName("max").active=true
this.scheduleOnce(()=>{
this.node.getChildByName("max").active=false
},0.8)
this.BUFFCOMP.max_show()
this.handle_skill(this.sk3)
}
}
@@ -457,10 +424,7 @@ export class HeroViewComp extends CCComp {
// console.log("闪避判断: i="+i+":dgr="+this.dgr);
if(i < this.dgr){
// console.log("闪避触发: i="+i+":dgr="+this.dgr);
this.node.getChildByName("max").active=true
this.scheduleOnce(()=>{
this.node.getChildByName("max").active=false
},0.8)
this.BUFFCOMP.max_show()
this.handle_skill(this.sk3)
}
}
@@ -472,10 +436,7 @@ export class HeroViewComp extends CCComp {
if(i < this.crr){
// console.log("暴击触发: i="+i+":crr="+this.crr);
this.node.getChildByName("max").active=true
this.scheduleOnce(()=>{
this.node.getChildByName("max").active=false
},0.8)
this.BUFFCOMP.max_show()
this.handle_skill(this.sk3)
}
}
@@ -485,10 +446,7 @@ export class HeroViewComp extends CCComp {
// console.log("受伤判断i="+i+":akr="+this.uar);
if(i < this.uar){
// console.log("受伤触发: i="+i+":uar="+this.uar);
this.node.getChildByName("max").active=true
this.scheduleOnce(()=>{
this.node.getChildByName("max").active=false
},0.8)
this.BUFFCOMP.max_show()
this.handle_skill(this.sk3)
}
}
@@ -616,13 +574,14 @@ export class HeroViewComp extends CCComp {
power_add(p:number){
this.pw+= p
}
hp_max_add(){
console.log("hp_max_add 动画");
}
/**
* 增加英雄的行动点数AP
* @param ap 要增加的行动点数。
* @param time 可选参数表示增加行动点数的时间默认为0。
*/
add_ap(ap: number,time:number=0){
this.ap += ap;
}
add_shield(shield:number){
this.shield =shield
console.log("shield:",shield);
@@ -636,7 +595,7 @@ export class HeroViewComp extends CCComp {
this.BUFFCOMP.tooltip(2,hp.toFixed(0));
}
add_hp_max(hp: number=0){
this.hp_max_add()
this.BUFFCOMP.show_buff(1)
this.hp += hp/100*this.hp_max;
}
hp_less(hp: number,is_crit:boolean=false){
@@ -675,7 +634,7 @@ export class HeroViewComp extends CCComp {
}
in_atked() {
this.BUFFCOMP.in_atked()
this.BUFFCOMP.in_atked()
// this.as.atked();
this.atked_count++;
this.exp_add(this.uaexp)
@@ -686,10 +645,24 @@ export class HeroViewComp extends CCComp {
this.exp_add(this.dexp)
this.power_add(this.dpw)
}
toDestroy(){
//进入墓地
to_grave(){
let pos =v3(-999,this.node.position.y)
if(this.box_group == BoxSet.MONSTER){
pos =v3(999,this.node.position.y)
smc.vmdata.mission.mdead +=1
}else{
smc.vmdata.mission.dead +=1
}
this.node.setPosition(pos)
}
toAlive(){
//是否在墓地
in_grave(){
return this.node.position.x < -900 || this.node.position.x > 900;
}
to_alive(){
let pos =v3(HeroSet.StartPos[this.type],this.node.position.y,this.node.position.z)
this.node.setPosition(pos)
}