buff修改

This commit is contained in:
2024-12-31 10:31:56 +08:00
parent b717167afd
commit c8cd32b9e4
5 changed files with 6606 additions and 616 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,265 @@
[
{
"__type__": "cc.AnimationClip",
"_name": "up",
"_objFlags": 0,
"__editorExtras__": {
"embeddedPlayerGroups": []
},
"_native": "",
"sample": 24,
"speed": 1,
"wrapMode": 2,
"enableTrsBlending": false,
"_duration": 0.4166666666666667,
"_hash": 500763545,
"_tracks": [
{
"__id__": 1
}
],
"_exoticAnimation": null,
"_events": [],
"_embeddedPlayers": [],
"_additiveSettings": {
"__id__": 12
},
"_auxiliaryCurveEntries": []
},
{
"__type__": "cc.animation.VectorTrack",
"_binding": {
"__type__": "cc.animation.TrackBinding",
"path": {
"__id__": 2
},
"proxy": null
},
"_channels": [
{
"__id__": 4
},
{
"__id__": 6
},
{
"__id__": 8
},
{
"__id__": 10
}
],
"_nComponents": 3
},
{
"__type__": "cc.animation.TrackPath",
"_paths": [
{
"__id__": 3
},
"position"
]
},
{
"__type__": "cc.animation.HierarchyPath",
"path": "Node"
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 5
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
0.2083333283662796,
0.4166666567325592
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 7
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
0.2083333283662796,
0.4166666567325592
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 10,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 9
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
0.2083333283662796,
0.4166666567325592
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 11
}
},
{
"__type__": "cc.RealCurve",
"_times": [],
"_values": [],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.AnimationClipAdditiveSettings",
"enabled": false,
"refClip": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "2.0.3",
"importer": "animation-clip",
"imported": true,
"uuid": "9599753d-1da0-4b0c-8e4a-8293c3035393",
"files": [
".cconb"
],
"subMetas": {},
"userData": {
"name": "up"
}
}

View File

@@ -18,57 +18,83 @@ export class BuffComp extends Component {
def_cd:number=0;
hp_cd:number=0;
crit_cd:number=0;
s_index=0
deap_cd:number=0;
decd_cd:number=0;
dedef_cd:number=0;
dehp_cd:number=0;
decrit_cd:number=0;
speek_time:number=0;
start() {
this.heroView = this.node.getComponent(HeroViewComp);
this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active = false;
this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").active = false;
this.node.getChildByName("top").getChildByName("buff").getChildByName("def").active = false;
this.node.getChildByName("top").getChildByName("buff").getChildByName("hp").active = false;
this.node.getChildByName("top").getChildByName("buff").getChildByName("crit").active = false;
// this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active = false;
// this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").active = false;
// this.node.getChildByName("top").getChildByName("buff").getChildByName("def").active = false;
// this.node.getChildByName("top").getChildByName("buff").getChildByName("hp").active = false;
// this.node.getChildByName("top").getChildByName("buff").getChildByName("crit").active = false;
}
update(deltaTime: number) {
if(this.ap_cd > 0 ) this.ap_cd -= deltaTime;
if(this.ap_cd <= 0 && this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active){
this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active = false;
this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").setSiblingIndex(0);
this.s_index--
if(this.s_index< 0) this.s_index=0
}
if(this.cd_cd > 0 ) this.cd_cd -= deltaTime;
if(this.cd_cd <= 0 && this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").active) {
this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").active = false;
this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").setSiblingIndex(0);
this.s_index--
if(this.s_index< 0) this.s_index=0
}
if(this.def_cd > 0 ) this.def_cd -= deltaTime;
if(this.def_cd <= 0 && this.node.getChildByName("top").getChildByName("buff").getChildByName("def").active){
this.node.getChildByName("top").getChildByName("buff").getChildByName("def").active = false;
this.node.getChildByName("top").getChildByName("buff").getChildByName("def").setSiblingIndex(0);
this.s_index--
if(this.s_index< 0) this.s_index=0
}
if(this.hp_cd > 0 ) this.hp_cd -= deltaTime;
if(this.hp_cd <= 0 && this.node.getChildByName("top").getChildByName("buff").getChildByName("hp").active){
this.node.getChildByName("top").getChildByName("buff").getChildByName("hp").active = false;
this.node.getChildByName("top").getChildByName("buff").getChildByName("hp").setSiblingIndex(0);
this.s_index--
if(this.s_index< 0) this.s_index=0
}
if(this.crit_cd > 0 ) this.crit_cd -= deltaTime;
if(this.crit_cd <= 0 && this.node.getChildByName("top").getChildByName("buff").getChildByName("crit").active){
this.node.getChildByName("top").getChildByName("buff").getChildByName("crit").active = false;
this.node.getChildByName("top").getChildByName("buff").getChildByName("crit").setSiblingIndex(0);
this.s_index--
if(this.s_index< 0) this.s_index=0
}
if(this.deap_cd > 0 ) this.deap_cd -= deltaTime;
if(this.deap_cd <= 0 && this.node.getChildByName("top").getChildByName("buff").getChildByName("deap").active){
this.node.getChildByName("top").getChildByName("buff").getChildByName("deap").active = false;
}
if(this.decd_cd > 0 ) this.decd_cd -= deltaTime;
if(this.decd_cd <= 0 && this.node.getChildByName("top").getChildByName("buff").getChildByName("decd").active) {
this.node.getChildByName("top").getChildByName("buff").getChildByName("decd").active = false;
}
if(this.dedef_cd > 0 ) this.dedef_cd -= deltaTime;
if(this.dedef_cd <= 0 && this.node.getChildByName("top").getChildByName("buff").getChildByName("dedef").active){
this.node.getChildByName("top").getChildByName("buff").getChildByName("dedef").active = false;
}
if(this.dehp_cd > 0 ) this.dehp_cd -= deltaTime;
if(this.dehp_cd <= 0 && this.node.getChildByName("top").getChildByName("buff").getChildByName("dehp").active){
this.node.getChildByName("top").getChildByName("buff").getChildByName("dehp").active = false;
}
if(this.decrit_cd > 0 ) this.decrit_cd -= deltaTime;
if(this.decrit_cd <= 0 && this.node.getChildByName("top").getChildByName("buff").getChildByName("decrit").active){
this.node.getChildByName("top").getChildByName("buff").getChildByName("decrit").active = false;
}
@@ -84,34 +110,46 @@ export class BuffComp extends Component {
show_ap(t:number=2){
this.ap_cd = t;
this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active = true;
this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").setSiblingIndex(this.s_index);
console.log("show_ap",this.node.getChildByName("top").getChildByName("buff").getChildByName("ap"))
this.s_index++
}
show_cd(t:number=2){
this.cd_cd = t;
this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").active = true;
this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").setSiblingIndex(this.s_index);
this.s_index++
}
show_def(t:number=2){
this.def_cd = t;
this.node.getChildByName("top").getChildByName("buff").getChildByName("def").active = true;
this.node.getChildByName("top").getChildByName("buff").getChildByName("def").setSiblingIndex(this.s_index);
this.s_index++
}
show_hp(t:number=2){
this.hp_cd = t;
this.node.getChildByName("top").getChildByName("buff").getChildByName("hp").active = true;
this.node.getChildByName("top").getChildByName("buff").getChildByName("hp").setSiblingIndex(this.s_index);
this.s_index++
}
show_crit(t:number=2){
this.crit_cd = t;
this.node.getChildByName("top").getChildByName("buff").getChildByName("crit").active = true;
this.node.getChildByName("top").getChildByName("buff").getChildByName("crit").setSiblingIndex(this.s_index);
this.s_index++
}
show_debuff_ap(t:number=2){
this.deap_cd = t;
this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active = true;
console.log("show_ap",this.node.getChildByName("top").getChildByName("buff").getChildByName("ap"))
}
show_debuff_cd(t:number=2){
this.decd_cd = t;
this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").active = true;
}
show_debuff_def(t:number=2){
this.dedef_cd = t;
this.node.getChildByName("top").getChildByName("buff").getChildByName("def").active = true;
}
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;
}
hp_show(){

View File

@@ -116,7 +116,8 @@ export class HeroViewComp extends CCComp {
stop_cd: number = 0.5; /*停止倒计时*/
yun_cd: number = 0.5; //眩晕倒计时
ice_cd: number = 0.5; //冰冻倒计时
dir_y:number = 0;
speek_time:number = 0;
@@ -203,6 +204,7 @@ export class HeroViewComp extends CCComp {
this.is_atking=true
}
}
onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D) {
}
update(dt: number){
@@ -215,15 +217,30 @@ export class HeroViewComp extends CCComp {
if (this.pwt.update(dt)) {
this.pw+=this.pws
}
this.check_power()
this.check_atk_buffs(dt)
this.check_atk_counts()
this.in_stop(dt);
this.at += dt;
this.check_atk_counts()
this.check_enemy_alive()
this.check_mission_buf()
if(this.ice_cd > 0){ this.ice_cd -=dt; return }
if(this.yun_cd > 0){ this.yun_cd -=dt; return }
this.at += dt;
this.in_stop(dt);
this.in_atk(dt);
this.move(dt);
this.check_mission_buf()
}
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(){
this.ap_max=(100+smc.vmdata.mission.ap)/100*this.ap
@@ -491,17 +508,6 @@ export class HeroViewComp extends CCComp {
}
}
}
exp_add(exp:number=0){
if(this.box_group==BoxSet.HERO){
smc.vmdata.mission.exp +=exp
}
if(this.box_group==BoxSet.MONSTER){
smc.vmdata.mission.mexp +=exp
}
}
power_add(p:number){
this.pw+= p
}
//使用max_skill
handle_skill(skill:number){
this.as.max()
@@ -599,9 +605,28 @@ export class HeroViewComp extends CCComp {
}
exp_add(exp:number=0){
if(this.box_group==BoxSet.HERO){
smc.vmdata.mission.exp +=exp
}
if(this.box_group==BoxSet.MONSTER){
smc.vmdata.mission.mexp +=exp
}
}
power_add(p:number){
this.pw+= p
}
hp_max_add(){
console.log("hp_max_add 动画");
}
add_ap(ap: number,time:number=0){
this.ap += ap;
}
add_shield(shield:number){
this.shield =shield
console.log("shield:",shield);
}
add_hp(hp: number=0){
this.BUFFCOMP.heathed();
this.hp+=hp;
@@ -638,33 +663,6 @@ export class HeroViewComp extends CCComp {
// }, 15);
}
}
add_ap(ap: number,time:number=0){
this.ap += ap;
}
check_atk_buffs(dt: number){
for(let i=0;i<this.ap_buffs.length;i++){
let buff=this.ap_buffs[i];
buff.time -= dt;
if(buff.time <= 0){
this.ap_buff -= buff.ap
this.ap_buffs.splice(i,1);
}
}
if(this.ap_buffs.length <= 0){
this.ap_buff = 0
}else{
}
}
buff_icon_change(icon:string,value:boolean){
// this.node.getChildByName("top").getChildByName("buff").getChildByName(icon).active=value
}
add_shield(shield:number){
this.shield =shield
console.log("shield:",shield);
}
/** 静止时间 */
in_stop (dt: number) {
if(this.stop_cd > 0){