diff --git a/assets/resources/common/prefab/notify.prefab b/assets/resources/common/prefab/notify.prefab index d143afc6..68735530 100644 --- a/assets/resources/common/prefab/notify.prefab +++ b/assets/resources/common/prefab/notify.prefab @@ -28,29 +28,26 @@ "__id__": 32 }, { - "__id__": 40 - }, - { - "__id__": 46 + "__id__": 38 } ], "_active": true, "_components": [ + { + "__id__": 46 + }, + { + "__id__": 48 + }, + { + "__id__": 50 + }, { "__id__": 52 - }, - { - "__id__": 54 - }, - { - "__id__": 56 - }, - { - "__id__": 58 } ], "_prefab": { - "__id__": 60 + "__id__": 54 }, "_lpos": { "__type__": "cc.Vec3", @@ -115,7 +112,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": 6.603999999999999, + "y": 0, "z": 0 }, "_lrot": { @@ -239,8 +236,8 @@ "_dstBlendFactor": 4, "_color": { "__type__": "cc.Color", - "r": 44, - "g": 190, + "r": 255, + "g": 255, "b": 255, "a": 255 }, @@ -383,8 +380,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 650, - "height": 100 + "width": 670, + "height": 120 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -414,9 +411,9 @@ "_dstBlendFactor": 4, "_color": { "__type__": "cc.Color", - "r": 0, - "g": 168, - "b": 255, + "r": 207, + "g": 207, + "b": 207, "a": 255 }, "_spriteFrame": { @@ -456,10 +453,10 @@ }, "_alignFlags": 45, "_target": null, - "_left": 25, - "_right": 25, - "_top": 25, - "_bottom": 25, + "_left": 15, + "_right": 15, + "_top": 15, + "_bottom": 15, "_horizontalCenter": 0, "_verticalCenter": 0, "_isAbsLeft": true, @@ -535,7 +532,7 @@ "_target": null, "_left": 0, "_right": 0, - "_top": -36.604, + "_top": -30, "_bottom": 0, "_horizontalCenter": 0, "_verticalCenter": 0, @@ -612,7 +609,7 @@ }, { "__type__": "cc.Node", - "_name": "ToastMessage_Bg_Gray", + "_name": "ItemIcon_Friend", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -633,8 +630,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, - "y": -7, + "x": -272.864, + "y": 81.674, "z": 0 }, "_lrot": { @@ -672,6 +669,142 @@ "__prefab": { "__id__": 28 }, + "_contentSize": { + "__type__": "cc.Size", + "width": 128, + "height": 102 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "a9hf76WyxLQJ6+ZCx3DyMR" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 26 + }, + "_enabled": true, + "__prefab": { + "__id__": 30 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@0b270", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "d9lUDNtkNEnrArfPBbuH7w" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "96AE+Ri4RBG5i2r2nH8xE6", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "ToastMessage_Bg_Gray", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": false, + "_components": [ + { + "__id__": 33 + }, + { + "__id__": 35 + } + ], + "_prefab": { + "__id__": 37 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -7, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 32 + }, + "_enabled": true, + "__prefab": { + "__id__": 34 + }, "_contentSize": { "__type__": "cc.Size", "width": 600, @@ -694,11 +827,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 26 + "__id__": 32 }, "_enabled": false, "__prefab": { - "__id__": 30 + "__id__": 36 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -758,17 +891,17 @@ "_active": true, "_components": [ { - "__id__": 33 + "__id__": 39 }, { - "__id__": 35 + "__id__": 41 }, { - "__id__": 37 + "__id__": 43 } ], "_prefab": { - "__id__": 39 + "__id__": 45 }, "_lpos": { "__type__": "cc.Vec3", @@ -805,11 +938,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 32 + "__id__": 38 }, "_enabled": true, "__prefab": { - "__id__": 34 + "__id__": 40 }, "_contentSize": { "__type__": "cc.Size", @@ -833,11 +966,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 32 + "__id__": 38 }, "_enabled": true, "__prefab": { - "__id__": 36 + "__id__": 42 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -901,11 +1034,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 32 + "__id__": 38 }, "_enabled": true, "__prefab": { - "__id__": 38 + "__id__": 44 }, "_params": [], "_dataID": "", @@ -928,278 +1061,6 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": null }, - { - "__type__": "cc.Node", - "_name": "Title_Line01_Divider_Left", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 1 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 41 - }, - { - "__id__": 43 - } - ], - "_prefab": { - "__id__": 45 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": -70, - "y": 49.03, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 - }, - "_mobility": 0, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 40 - }, - "_enabled": true, - "__prefab": { - "__id__": 42 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 240, - "height": 42 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 1, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "1atOy5C2ZLgI/QC9myGilF" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 40 - }, - "_enabled": true, - "__prefab": { - "__id__": 44 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "260d01c4-5936-4c90-8ff9-b892c60b2e48@71ae6", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 1, - "_fillType": 0, - "_sizeMode": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "3dy0eNNjNLAqDK5RcQ62mu" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "77shkHdtRL46F0xrvcLtcW", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "Title_Line01_Divider_Right", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 1 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 47 - }, - { - "__id__": 49 - } - ], - "_prefab": { - "__id__": 51 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 70, - "y": 49.03, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 - }, - "_mobility": 0, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 46 - }, - "_enabled": true, - "__prefab": { - "__id__": 48 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 240, - "height": 42 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "46Sla1x4FKt738DUIgTJsk" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 46 - }, - "_enabled": true, - "__prefab": { - "__id__": 50 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "260d01c4-5936-4c90-8ff9-b892c60b2e48@b64ba", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 1, - "_fillType": 0, - "_sizeMode": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "74FimAkkhHzJxNxuoh6M9O" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "dbX2Yia/lCQ4WTih9AzBfF", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, { "__type__": "cc.UITransform", "_name": "", @@ -1210,7 +1071,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 53 + "__id__": 47 }, "_contentSize": { "__type__": "cc.Size", @@ -1238,7 +1099,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 55 + "__id__": 49 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1280,7 +1141,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 57 + "__id__": 51 }, "playOnLoad": true, "_clips": [ @@ -1309,13 +1170,13 @@ }, "_enabled": true, "__prefab": { - "__id__": 59 + "__id__": 53 }, "lab_content": { - "__id__": 35 + "__id__": 41 }, "animation": { - "__id__": 56 + "__id__": 50 }, "_id": "" }, diff --git a/assets/resources/game/gui/lcard.prefab b/assets/resources/game/gui/lcard.prefab index cde89fea..fcc1c7f8 100644 --- a/assets/resources/game/gui/lcard.prefab +++ b/assets/resources/game/gui/lcard.prefab @@ -148,8 +148,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 240, - "height": 240 + "width": 300, + "height": 140 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -282,8 +282,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, - "y": -80, + "x": 57.5, + "y": 0, "z": 0 }, "_lrot": { @@ -323,8 +323,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 220, - "height": 60 + "width": 145, + "height": 100 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -396,10 +396,10 @@ }, "_alignFlags": 45, "_target": null, - "_left": 10, - "_right": 10, - "_top": 170, - "_bottom": 10, + "_left": 135, + "_right": 20, + "_top": 20, + "_bottom": 20, "_horizontalCenter": 0, "_verticalCenter": 0, "_isAbsLeft": true, @@ -457,8 +457,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, - "y": 30, + "x": -80, + "y": 0, "z": 0 }, "_lrot": { @@ -498,8 +498,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 150, - "height": 150 + "width": 100, + "height": 100 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -569,11 +569,11 @@ "__prefab": { "__id__": 24 }, - "_alignFlags": 45, + "_alignFlags": 9, "_target": null, - "_left": 45, - "_right": 45, - "_top": 15, + "_left": 20, + "_right": 140, + "_top": 20, "_bottom": 75, "_horizontalCenter": 0, "_verticalCenter": 0, @@ -632,8 +632,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": -83.447, - "y": -79.321, + "x": 60, + "y": 20, "z": 0 }, "_lrot": { @@ -673,12 +673,12 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 220, - "height": 220 + "width": 130, + "height": 40 }, "_anchorPoint": { "__type__": "cc.Vec2", - "x": 0, + "x": 0.5, "y": 0.5 }, "_id": "" @@ -710,9 +710,9 @@ "a": 255 }, "_string": "攻击力", - "_horizontalAlign": 0, + "_horizontalAlign": 1, "_verticalAlign": 1, - "_actualFontSize": 31, + "_actualFontSize": 30, "_fontSize": 30, "_fontFamily": "Arial", "_lineHeight": 40, @@ -767,12 +767,12 @@ "__prefab": { "__id__": 32 }, - "_alignFlags": 45, + "_alignFlags": 41, "_target": null, - "_left": 36.553, - "_right": -16.552999999999997, - "_top": 89.321, - "_bottom": -69.321, + "_left": 145, + "_right": 25, + "_top": 30, + "_bottom": 63.266000000000005, "_horizontalCenter": 0, "_verticalCenter": 0, "_isAbsLeft": true, @@ -830,8 +830,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 19.622000000000014, - "y": -79.321, + "x": 60, + "y": -25.2, "z": 0 }, "_lrot": { @@ -871,12 +871,12 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 220, - "height": 220 + "width": 130, + "height": 50.4 }, "_anchorPoint": { "__type__": "cc.Vec2", - "x": 0, + "x": 0.5, "y": 0.5 }, "_id": "" @@ -908,7 +908,7 @@ "a": 255 }, "_string": "+20", - "_horizontalAlign": 0, + "_horizontalAlign": 1, "_verticalAlign": 1, "_actualFontSize": 31, "_fontSize": 30, @@ -965,12 +965,12 @@ "__prefab": { "__id__": 40 }, - "_alignFlags": 45, + "_alignFlags": 41, "_target": null, - "_left": 139.622, - "_right": -119.622, - "_top": 89.321, - "_bottom": -69.321, + "_left": 145, + "_right": 25, + "_top": 70, + "_bottom": 63.266000000000005, "_horizontalCenter": 0, "_verticalCenter": 0, "_isAbsLeft": true, @@ -1016,8 +1016,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 240, - "height": 240 + "width": 300, + "height": 140 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1053,7 +1053,10 @@ "__expectedType__": "cc.AnimationClip" } ], - "_defaultClip": null, + "_defaultClip": { + "__uuid__": "846a3928-d2e7-413a-b9db-b67b2bc4c2a5", + "__expectedType__": "cc.AnimationClip" + }, "_id": "" }, { diff --git a/assets/resources/gui/role_controller.prefab b/assets/resources/gui/role_controller.prefab index dc05dc7f..b7eea0ab 100644 --- a/assets/resources/gui/role_controller.prefab +++ b/assets/resources/gui/role_controller.prefab @@ -93045,7 +93045,7 @@ "_pressedSprite": null, "_disabledSprite": null, "_duration": 0.1, - "_zoomScale": 1.2, + "_zoomScale": 1.5, "_target": null, "_id": "" }, diff --git a/assets/script/game/common/config/CardSet.ts b/assets/script/game/common/config/CardSet.ts index 26233d53..61e769fe 100644 --- a/assets/script/game/common/config/CardSet.ts +++ b/assets/script/game/common/config/CardSet.ts @@ -3,7 +3,7 @@ */ import { getHeroList, HeroList } from "./heroSet" -import { getSkills, HeroSkillList, SkillSet } from "./SkillSet" +import { BuffAttr, getSkills, HeroSkillList, SkillSet } from "./SkillSet" import { equip_list, weapons, armors, accessorys, getEquipUUIDsByType } from "./Equips" import { getEnhancement } from "./LevelUp" import { TalentList } from "./TalentSet" @@ -162,13 +162,16 @@ export const Quality={ ORANGE:5, } -export const SuperCardsList=[3101,3102,3103]; +export const SuperCardsList=[3101,3102,3103,3104,3105,3106]; export const SuperCards={ - 3101:{uuid:3101,name:"陨石爆",quality:Quality.GREEN,path:"3101",CTarget:CTarget.ENEMY,type:SuperCardsType.AOE,value1:SkillSet[6032].uuid,value2:10,value3:0, + 3101:{uuid:3101,name:"陨石爆",quality:Quality.GREEN,path:"3101",CTarget:CTarget.ENEMY,type:SuperCardsType.AOE,value1:SkillSet[6032].uuid,value2:1,value3:0, info:"召唤大量火球攻击敌人,每个火球对敌人造成英雄攻击力的300%伤害"}, - 3102:{uuid:3102,name:"龙卷群",quality:Quality.BLUE,path:"3104",CTarget:CTarget.ENEMY,type:SuperCardsType.AOE,value1:SkillSet[6033].uuid,value2:10,value3:0, + 3102:{uuid:3102,name:"龙卷群",quality:Quality.BLUE,path:"3104",CTarget:CTarget.ENEMY,type:SuperCardsType.AOE,value1:SkillSet[6033].uuid,value2:1,value3:0, info:"召唤大量火球攻击敌人,每个火球对敌人造成英雄攻击力的300%伤害"}, - 3103:{uuid:3103,name:"大海啸",quality:Quality.PURPLE,path:"3105",CTarget:CTarget.ENEMY,type:SuperCardsType.AOE,value1:SkillSet[6034].uuid,value2:10,value3:0, + 3103:{uuid:3103,name:"大海啸",quality:Quality.PURPLE,path:"3105",CTarget:CTarget.ENEMY,type:SuperCardsType.AOE,value1:SkillSet[6034].uuid,value2:1,value3:0, info:"召唤大量火球攻击敌人,每个火球对敌人造成英雄攻击力的300%伤害"}, + 3104:{uuid:3104,name:"攻击力",quality:Quality.ORANGE,path:"3106",CTarget:CTarget.MASTER,type:SuperCardsType.BUFF,value1:BuffAttr.AP,value2:5,value3:0}, + 3105:{uuid:3105,name:"生命值",quality:Quality.ORANGE,path:"3107",CTarget:CTarget.MASTER,type:SuperCardsType.BUFF,value1:BuffAttr.HP_MAX,value2:5,value3:0}, + 3106:{uuid:3106,name:"防御值",quality:Quality.ORANGE,path:"3108",CTarget:CTarget.MASTER,type:SuperCardsType.BUFF,value1:BuffAttr.DEF,value2:5,value3:0}, } diff --git a/assets/script/game/common/config/GameEvent.ts b/assets/script/game/common/config/GameEvent.ts index 8f7c3b2f..0b6a33d9 100644 --- a/assets/script/game/common/config/GameEvent.ts +++ b/assets/script/game/common/config/GameEvent.ts @@ -33,6 +33,7 @@ export enum GameEvent { EnhancementSelect = "EnhancementSelect", CanUpdateLv = "CanUpdateLv", UseEnhancement = "UseEnhancement", + LuckCardUsed = "LuckCardUsed", MasterCalled = "MasterCalled", FightStart = "FightStart", FightPause = "FightPause", diff --git a/assets/script/game/hero/HeroConComp.ts b/assets/script/game/hero/HeroConComp.ts index 1dd749ba..43f4cd39 100644 --- a/assets/script/game/hero/HeroConComp.ts +++ b/assets/script/game/hero/HeroConComp.ts @@ -9,6 +9,7 @@ import { BuffAttr } from "../common/config/SkillSet"; import { EnhancementType } from "../common/config/LevelUp"; import { TalentList } from "../common/config/TalentSet"; import { smc } from "../common/SingletonModuleComp"; +import { SuperCards, SuperCardsType } from "../common/config/CardSet"; const { ccclass, property } = _decorator; @@ -26,6 +27,7 @@ export class HeroConComp extends CCComp { this.on(GameEvent.UseEnhancement,this.use_enhancement,this) this.on(GameEvent.UseTalentCard,this.use_talent_card,this) this.on(GameEvent.RemoveTalent,this.remove_talent_card,this) + this.on(GameEvent.LuckCardUsed,this.luck_card_used,this) this.heroView=this.node.getComponent(HeroViewComp) console.log("[HeroConCompComp]:onLoad",this.heroView) @@ -104,108 +106,78 @@ export class HeroConComp extends CCComp { use_talent_card(e:GameEvent,data:any){ console.log("[HeroConCompComp]:use_talent_card",data) let tal=TalentList[data.uuid] - switch(tal.buffType){ - case BuffAttr.ATK: - this.heroView.TALENT[BuffAttr.ATK]+=tal.value - this.heroView.count_atrr(BuffAttr.ATK) + this.do_buff_func(tal.buffType,tal.value) + } + + remove_talent_card(e:GameEvent,data:any){ + let tal=TalentList[data.uuid] + console.log("[HeroConCompComp]:remove_talent_card",data,tal) + this.do_buff_func(tal.buffType,-tal.value) + } + luck_card_used(e:GameEvent,card:any){ + switch(card.type){ + case SuperCardsType.BUFF: + this.do_buff_func(card.value1,card.value2) break - case BuffAttr.ATK_CD: - this.heroView.TALENT[BuffAttr.ATK_CD]+=tal.value - this.heroView.count_atrr(BuffAttr.ATK_CD) - break - case BuffAttr.SKILL_CD: - smc.vmdata.hero.skill_cd_buff+=tal.value //直接加到vmdata中 - break - case BuffAttr.HP: - this.heroView.TALENT[BuffAttr.HP]+=tal.value - this.heroView.count_atrr(BuffAttr.HP) - break - case BuffAttr.DEF: - this.heroView.change_def(tal.value) - break - case BuffAttr.CRITICAL: - this.heroView.change_crit(tal.value) - break - case BuffAttr.CRITICAL_DMG: - this.heroView.change_crit_d(tal.value) - break - case BuffAttr.DODGE: - this.heroView.change_dodge(tal.value) - break - case BuffAttr.PUNCTURE: - this.heroView.change_puncture(tal.value) - break - case BuffAttr.PUNCTURE_DMG: - this.heroView.change_puncture_damage(tal.value) - break - case BuffAttr.FROST_RATIO: - this.heroView.change_frost_ratto(tal.value) - break - case BuffAttr.KNOCKBACK: - this.heroView.change_knockback(tal.value) - break - case BuffAttr.STUN_RATTO: - this.heroView.change_stun_ratto(tal.value) - break - case BuffAttr.LIFESTEAL: - this.heroView.change_lifesteal(tal.value) - break - case BuffAttr.WFUNY: - this.heroView.change_wfuny(tal.value) + case SuperCardsType.AOE: + //do skill break } } - remove_talent_card(e:GameEvent,data:any){ - - let tal=TalentList[data.uuid] - console.log("[HeroConCompComp]:remove_talent_card",data,tal) - switch(tal.buffType){ - case BuffAttr.ATK: - console.log("[HeroConCompComp]:atk",this.heroView.TALENT[BuffAttr.ATK],tal.value) - this.heroView.TALENT[BuffAttr.ATK]-=tal.value + do_buff_func(buffType:number,value:number){ + switch(buffType){ + case BuffAttr.AP: + this.heroView.ap_base+=value + this.heroView.count_atrr(BuffAttr.ATK) + break + case BuffAttr.HP_MAX: + this.heroView.hp_base+=value + this.heroView.count_atrr(BuffAttr.HP) + break + case BuffAttr.ATK: + this.heroView.TALENT[BuffAttr.ATK]+=value this.heroView.count_atrr(BuffAttr.ATK) - console.log("[HeroConCompComp]ed:atk",this.heroView.TALENT[BuffAttr.ATK],tal.value) break case BuffAttr.ATK_CD: - this.heroView.TALENT[BuffAttr.ATK_CD]-=tal.value + this.heroView.TALENT[BuffAttr.ATK_CD]+=value this.heroView.count_atrr(BuffAttr.ATK_CD) break case BuffAttr.HP: - this.heroView.TALENT[BuffAttr.HP]-=tal.value + this.heroView.TALENT[BuffAttr.HP]+=value break case BuffAttr.DEF: - this.heroView.change_def(-tal.value) + this.heroView.change_def(value) break case BuffAttr.CRITICAL: - this.heroView.change_crit(-tal.value) + this.heroView.change_crit(value) break case BuffAttr.CRITICAL_DMG: - this.heroView.change_crit_d(-tal.value) + this.heroView.change_crit_d(value) break case BuffAttr.DODGE: - this.heroView.change_dodge(-tal.value) + this.heroView.change_dodge(value) break case BuffAttr.PUNCTURE: - this.heroView.change_puncture(-tal.value) + this.heroView.change_puncture(value) break case BuffAttr.PUNCTURE_DMG: - this.heroView.change_puncture_damage(-tal.value) + this.heroView.change_puncture_damage(value) break case BuffAttr.FROST_RATIO: - this.heroView.change_frost_ratto(-tal.value) + this.heroView.change_frost_ratto(value) break case BuffAttr.KNOCKBACK: - this.heroView.change_knockback(-tal.value) + this.heroView.change_knockback(value) break case BuffAttr.STUN_RATTO: - this.heroView.change_stun_ratto(-tal.value) + this.heroView.change_stun_ratto(value) break case BuffAttr.REFLECT: - this.heroView.change_reflect(-tal.value) + this.heroView.change_reflect(value) break case BuffAttr.LIFESTEAL: - this.heroView.change_lifesteal(-tal.value) + this.heroView.change_lifesteal(value) break } } diff --git a/assets/script/game/map/LuckCardComp.ts b/assets/script/game/map/LuckCardComp.ts index eb58bdef..f1c4c1c2 100644 --- a/assets/script/game/map/LuckCardComp.ts +++ b/assets/script/game/map/LuckCardComp.ts @@ -1,4 +1,6 @@ -import { _decorator, Animation, Component, Node, tween, v3 } from 'cc'; +import { _decorator, Animation, Component, Label, Node, resources, Sprite, SpriteAtlas, tween, v3 } from 'cc'; +import { SuperCards, SuperCardsType } from '../common/config/CardSet'; +import { SkillSet } from '../common/config/SkillSet'; const { ccclass, property } = _decorator; @ccclass('LuckCardComp') @@ -18,6 +20,22 @@ export class LuckCardComp extends Component { this.timer=2 } } + show_card(card:any){ + var icon_path = "game/heros/cards" + resources.load(icon_path, SpriteAtlas, (err: any, atlas) => { + const sprite = this.node.getChildByName("icon").getComponent(Sprite); + sprite.spriteFrame = atlas.getSpriteFrame(SuperCards[card.uuid].path); + }); + this.node.getChildByName("name").getComponent(Label).string=SuperCards[card.uuid].name + switch(SuperCards[card.uuid].type){ + case SuperCardsType.BUFF: + this.node.getChildByName("val").getComponent(Label).string="+"+SuperCards[card.uuid].value2 + break + case SuperCardsType.AOE: + this.node.getChildByName("val").getComponent(Label).string=SkillSet[SuperCards[card.uuid].value1].name+"X"+SuperCards[card.uuid].value2 + break + } + } do_destroy(){ tween(this.node) .to(0.2, { diff --git a/assets/script/game/map/MissionComp.ts b/assets/script/game/map/MissionComp.ts index 324d141a..aacfe5ba 100644 --- a/assets/script/game/map/MissionComp.ts +++ b/assets/script/game/map/MissionComp.ts @@ -12,6 +12,8 @@ import { defaultEnhancements, EnhancementOptions } from "../common/config/LevelU import { MonModelComp } from "../hero/MonModelComp"; import { TalentSlot } from "../common/config/TalentSet"; import { RogueTalWave } from "./RogueConfig"; +import { cardType, getRandomCardsByType, SuperCards, SuperCardsList, SuperCardsType } from "../common/config/CardSet"; +import { LuckCardComp } from "./LuckCardComp"; const { ccclass, property } = _decorator; @@ -293,17 +295,30 @@ export class MissionComp extends CCComp { } call_func_card(){ - this.show_lucky_gold() + if(smc.vmdata.mission_data.gold < smc.vmdata.mission_data.lucky_gold){ + oops.gui.toast("金币不足", false); + return + } + this.do_lucky_card() } - show_lucky_gold(){ + do_lucky_card(){ + smc.vmdata.mission_data.gold-=smc.vmdata.mission_data.lucky_gold + let list=getRandomCardsByType(cardType.SPECIAL,1) + let card=SuperCards[list[0].uuid] + console.log("[MissionComp] do_lucky_card",card) + this.show_lucky_gold(card) + oops.message.dispatchEvent(GameEvent.LuckCardUsed,card) + } + show_lucky_gold(card:any){ var path = "game/gui/lcard"; var prefab: Prefab = oops.res.get(path, Prefab)!; var node = instantiate(prefab); node.setScale(0,0,0) + node.getComponent(LuckCardComp).show_card(card) node.parent = this.node node.setPosition(v3(this.node.getChildByName("luckybox").position.x,this.node.getChildByName("luckybox").position.y)); - let height=this.node.getComponent(UITransform).height + let height=this.node.getComponent(UITransform).height tween(node) .to(0.5, { scale: v3(1,1,1), position: v3(0, height-300),