+刷新次数的增加和广告入口
This commit is contained in:
1140
assets/resources/gui/anim/stars.anim
Normal file
1140
assets/resources/gui/anim/stars.anim
Normal file
File diff suppressed because it is too large
Load Diff
13
assets/resources/gui/anim/stars.anim.meta
Normal file
13
assets/resources/gui/anim/stars.anim.meta
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"ver": "2.0.3",
|
||||||
|
"importer": "animation-clip",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "558e9cd1-56e8-4415-96c5-7fce08c3deab",
|
||||||
|
"files": [
|
||||||
|
".cconb"
|
||||||
|
],
|
||||||
|
"subMetas": {},
|
||||||
|
"userData": {
|
||||||
|
"name": "stars"
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -58,7 +58,9 @@ export enum GameEvent {
|
|||||||
UpdateHP = "UpdateHP",
|
UpdateHP = "UpdateHP",
|
||||||
APChange = "APChange",
|
APChange = "APChange",
|
||||||
EXPUP = "EXPUP",
|
EXPUP = "EXPUP",
|
||||||
|
AD_BACK_TRUE = "AD_BACK_TRUE",
|
||||||
|
AD_BACK_FALSE = "AD_BACK_FALSE",
|
||||||
|
DO_AD_BACK = "DO_AD_BACK",
|
||||||
ShopOpen = "ShopOpen",
|
ShopOpen = "ShopOpen",
|
||||||
RestOpen = "RestOpen",
|
RestOpen = "RestOpen",
|
||||||
HeroLvUp = "HeroLvUp",
|
HeroLvUp = "HeroLvUp",
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ export enum FightSet {
|
|||||||
DODGE_TO_POWER=1,//闪避涨能量
|
DODGE_TO_POWER=1,//闪避涨能量
|
||||||
ONE_WAVE_TIME=30,//单波时间
|
ONE_WAVE_TIME=30,//单波时间
|
||||||
DOWN_TIME=5,//倒计时时间
|
DOWN_TIME=5,//倒计时时间
|
||||||
|
MORE_RC=10,//更多次数 广告获取的次数
|
||||||
// ATK_TO_ATK_RATIO=0.1,
|
// ATK_TO_ATK_RATIO=0.1,
|
||||||
// ATK_TO_HP_RATIO=0.2,
|
// ATK_TO_HP_RATIO=0.2,
|
||||||
// ATK_TO_SHIELD_RATIO=2,
|
// ATK_TO_SHIELD_RATIO=2,
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import { RandomManager } from "db://oops-framework/core/common/random/RandomMana
|
|||||||
import { EquipType } from "../common/config/Equips";
|
import { EquipType } from "../common/config/Equips";
|
||||||
import { getSkills, Quality } from "../common/config/SkillSet";
|
import { getSkills, Quality } from "../common/config/SkillSet";
|
||||||
import { getEnhancement } from "../common/config/LevelUp";
|
import { getEnhancement } from "../common/config/LevelUp";
|
||||||
|
import { FightSet } from "../common/config/Mission";
|
||||||
|
import { oops } from "db://oops-framework/core/Oops";
|
||||||
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
@@ -24,7 +26,9 @@ export class CardsCompComp extends CCComp {
|
|||||||
card2c:CardComp=null
|
card2c:CardComp=null
|
||||||
card3c:CardComp=null
|
card3c:CardComp=null
|
||||||
// card4c:CardComp=null
|
// card4c:CardComp=null
|
||||||
|
more_btn:any=null
|
||||||
|
refresh_btn:any=null
|
||||||
|
cancel_btn:any=null
|
||||||
/** 卡牌展示队列 */
|
/** 卡牌展示队列 */
|
||||||
private cardQueue: Array<{type: GameEvent, data?: any}> = [];
|
private cardQueue: Array<{type: GameEvent, data?: any}> = [];
|
||||||
/** 是否正在展示卡牌 */
|
/** 是否正在展示卡牌 */
|
||||||
@@ -48,6 +52,8 @@ export class CardsCompComp extends CCComp {
|
|||||||
this.on(GameEvent.EquipSelect, this.addToQueue, this);
|
this.on(GameEvent.EquipSelect, this.addToQueue, this);
|
||||||
this.on(GameEvent.EnhancementSelect, this.addToQueue, this);
|
this.on(GameEvent.EnhancementSelect, this.addToQueue, this);
|
||||||
this.on(GameEvent.TalentSelect, this.addToQueue, this);
|
this.on(GameEvent.TalentSelect, this.addToQueue, this);
|
||||||
|
this.on(GameEvent.AD_BACK_TRUE,this.ad_back_true,this)
|
||||||
|
this.on(GameEvent.AD_BACK_FALSE,this.ad_back_false,this)
|
||||||
this.card1=this.node.getChildByName("cards").getChildByName("card1")
|
this.card1=this.node.getChildByName("cards").getChildByName("card1")
|
||||||
this.card2=this.node.getChildByName("cards").getChildByName("card2")
|
this.card2=this.node.getChildByName("cards").getChildByName("card2")
|
||||||
this.card3=this.node.getChildByName("cards").getChildByName("card3")
|
this.card3=this.node.getChildByName("cards").getChildByName("card3")
|
||||||
@@ -56,12 +62,13 @@ export class CardsCompComp extends CCComp {
|
|||||||
this.card2c=this.card2.getComponent(CardComp)
|
this.card2c=this.card2.getComponent(CardComp)
|
||||||
this.card3c=this.card3.getComponent(CardComp)
|
this.card3c=this.card3.getComponent(CardComp)
|
||||||
// this.card4c=this.card4.getComponent(CardComp)
|
// this.card4c=this.card4.getComponent(CardComp)
|
||||||
|
this.more_btn=this.node.getChildByName("btns").getChildByName("more")
|
||||||
|
this.refresh_btn=this.node.getChildByName("btns").getChildByName("new")
|
||||||
|
this.cancel_btn=this.node.getChildByName("btns").getChildByName("cancel")
|
||||||
}
|
}
|
||||||
|
|
||||||
show_cards(e:GameEvent,data:any,is_refresh:boolean=false){
|
show_cards(e:GameEvent,data:any,is_refresh:boolean=false){
|
||||||
this.node.getChildByName("btns").getChildByName("cancel").active=false
|
this.cancel_btn.active=false
|
||||||
switch(e){
|
switch(e){
|
||||||
case GameEvent.HeroSelect:
|
case GameEvent.HeroSelect:
|
||||||
console.log("[CardsComp]:显示英雄选择卡牌",data)
|
console.log("[CardsComp]:显示英雄选择卡牌",data)
|
||||||
@@ -77,25 +84,25 @@ export class CardsCompComp extends CCComp {
|
|||||||
break
|
break
|
||||||
case GameEvent.FuncSelect:
|
case GameEvent.FuncSelect:
|
||||||
console.log("[CardsComp]:显示功能卡牌")
|
console.log("[CardsComp]:显示功能卡牌")
|
||||||
this.node.getChildByName("btns").getChildByName("cancel").active=true
|
this.cancel_btn.active=true
|
||||||
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择卡牌"
|
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择卡牌"
|
||||||
this.func_select()
|
this.func_select()
|
||||||
break
|
break
|
||||||
case GameEvent.EquipSelect:
|
case GameEvent.EquipSelect:
|
||||||
console.log("[CardsComp]:显示装备选择卡牌")
|
console.log("[CardsComp]:显示装备选择卡牌")
|
||||||
this.node.getChildByName("btns").getChildByName("cancel").active=true
|
this.cancel_btn.active=true
|
||||||
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择装备"
|
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择装备"
|
||||||
this.equip_select(data)
|
this.equip_select(data)
|
||||||
break
|
break
|
||||||
case GameEvent.EnhancementSelect:
|
case GameEvent.EnhancementSelect:
|
||||||
console.log("[CardsComp]:显示强化选择卡牌")
|
console.log("[CardsComp]:显示强化选择卡牌")
|
||||||
this.node.getChildByName("btns").getChildByName("cancel").active=true
|
this.cancel_btn.active=true
|
||||||
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择强化"
|
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择强化"
|
||||||
this.enhancement_select()
|
this.enhancement_select()
|
||||||
break
|
break
|
||||||
case GameEvent.TalentSelect:
|
case GameEvent.TalentSelect:
|
||||||
console.log("[CardsComp]:显示天赋选择卡牌")
|
console.log("[CardsComp]:显示天赋选择卡牌")
|
||||||
this.node.getChildByName("btns").getChildByName("cancel").active=true
|
this.cancel_btn.active=true
|
||||||
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择天赋"
|
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择天赋"
|
||||||
this.talent_select(data)
|
this.talent_select(data)
|
||||||
break
|
break
|
||||||
@@ -220,7 +227,6 @@ export class CardsCompComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
show(){
|
show(){
|
||||||
this.node.getChildByName("vip").active=false
|
|
||||||
// 设置初始状态
|
// 设置初始状态
|
||||||
smc.mission.pause=true
|
smc.mission.pause=true
|
||||||
// this.node.getChildByName("btns").getChildByName("cancel").setPosition(v3(0, this.node.getChildByName("btns").getChildByName("cancel").getPosition().y, 0))
|
// this.node.getChildByName("btns").getChildByName("cancel").setPosition(v3(0, this.node.getChildByName("btns").getChildByName("cancel").getPosition().y, 0))
|
||||||
@@ -235,13 +241,9 @@ export class CardsCompComp extends CCComp {
|
|||||||
tween().to(0.3, { position: v3(0, 640, 0) }, { easing: 'backOut' })
|
tween().to(0.3, { position: v3(0, 640, 0) }, { easing: 'backOut' })
|
||||||
)
|
)
|
||||||
.start();
|
.start();
|
||||||
let vip = RandomManager.instance.getRandomInt(0,100)
|
this.is_countdown=true
|
||||||
console.log("[CardsComp]:vip",vip)
|
this.countdown_time=10
|
||||||
if(vip < 30){
|
|
||||||
this.node.getChildByName("vip").active=true
|
|
||||||
this.is_countdown=true
|
|
||||||
this.countdown_time=10
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hide(){
|
hide(){
|
||||||
@@ -264,7 +266,34 @@ export class CardsCompComp extends CCComp {
|
|||||||
this.close_cards(GameEvent.CardsClose,null)
|
this.close_cards(GameEvent.CardsClose,null)
|
||||||
}
|
}
|
||||||
refresh_card(){
|
refresh_card(){
|
||||||
this.show_cards(this.now_card.type,this.now_card.data,true)
|
if(smc.vmdata.mission_data.refresh_count>0){
|
||||||
|
smc.vmdata.mission_data.refresh_count--
|
||||||
|
this.show_cards(this.now_card.type,this.now_card.data,true)
|
||||||
|
if(smc.vmdata.mission_data.refresh_count==0){
|
||||||
|
this.more_btn.active=true
|
||||||
|
this.refresh_btn.active=false
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.more_btn.active=true
|
||||||
|
this.refresh_btn.active=false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ad_callback(){
|
||||||
|
oops.message.dispatchEvent(GameEvent.DO_AD_BACK)
|
||||||
|
}
|
||||||
|
|
||||||
|
ad_back_true(){
|
||||||
|
this.more_btn.active=false
|
||||||
|
this.refresh_btn.active=true
|
||||||
|
}
|
||||||
|
ad_back_false(){
|
||||||
|
this.more_btn.active=true
|
||||||
|
this.refresh_btn.active=false
|
||||||
|
}
|
||||||
|
//检测广告是否成功观看
|
||||||
|
checkout_ad_back(){
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
//放弃选择
|
//放弃选择
|
||||||
give_up_select(){
|
give_up_select(){
|
||||||
@@ -272,23 +301,12 @@ export class CardsCompComp extends CCComp {
|
|||||||
// let mission_data=smc.vmdata.mission_data
|
// let mission_data=smc.vmdata.mission_data
|
||||||
// mission_data.gold+=(mission_data.back_gold+mission_data.buff_back_gold) //返还金币
|
// mission_data.gold+=(mission_data.back_gold+mission_data.buff_back_gold) //返还金币
|
||||||
}
|
}
|
||||||
//点击看视频广告
|
|
||||||
to_do_vip(){
|
|
||||||
if(this.checkout_vip()){
|
|
||||||
console.log("[CardsComp]:vip检查通过")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//检测广告是否成功观看
|
|
||||||
checkout_vip(){
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
update(dt: number) {
|
update(dt: number) {
|
||||||
if(this.is_countdown){
|
if(this.is_countdown){
|
||||||
this.countdown_time-=dt
|
this.countdown_time-=dt
|
||||||
this.node.getChildByName("vip").getChildByName("num").getComponent(Label).string=Math.floor(this.countdown_time).toString()
|
|
||||||
if(this.countdown_time<=0){
|
if(this.countdown_time<=0){
|
||||||
this.is_countdown=false
|
this.is_countdown=false
|
||||||
this.node.getChildByName("vip").active=false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ export class MissionComp extends CCComp {
|
|||||||
|
|
||||||
this.on(GameEvent.FightEnd,this.fight_end,this)
|
this.on(GameEvent.FightEnd,this.fight_end,this)
|
||||||
this.on(GameEvent.MissionEnd,this.mission_end,this)
|
this.on(GameEvent.MissionEnd,this.mission_end,this)
|
||||||
|
this.on(GameEvent.DO_AD_BACK,this.do_ad,this)
|
||||||
// this.on(GameEvent.CanUpdateLv,this.show_uplv_button,this)
|
// this.on(GameEvent.CanUpdateLv,this.show_uplv_button,this)
|
||||||
// this.on(GameEvent.UseEnhancement,this.hide_uplv_button,this)
|
// this.on(GameEvent.UseEnhancement,this.hide_uplv_button,this)
|
||||||
|
|
||||||
@@ -121,7 +122,20 @@ export class MissionComp extends CCComp {
|
|||||||
this.show_wave_time()
|
this.show_wave_time()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_ad(){
|
||||||
|
if(this.ad_back()){
|
||||||
|
oops.message.dispatchEvent(GameEvent.AD_BACK_TRUE)
|
||||||
|
smc.vmdata.mission_data.refresh_count+=FightSet.MORE_RC
|
||||||
|
}else{
|
||||||
|
oops.message.dispatchEvent(GameEvent.AD_BACK_FALSE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ad_back(){
|
||||||
|
|
||||||
|
return true
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
show_wave_time(){
|
show_wave_time(){
|
||||||
smc.vmdata.mission_data.wave_time_num=FightSet.ONE_WAVE_TIME
|
smc.vmdata.mission_data.wave_time_num=FightSet.ONE_WAVE_TIME
|
||||||
|
|||||||
@@ -118,6 +118,8 @@ export class TalsComp extends Component {
|
|||||||
icon.getChildByName("q5").active=TalentList[uuid].quality==Quality.ORANGE
|
icon.getChildByName("q5").active=TalentList[uuid].quality==Quality.ORANGE
|
||||||
}
|
}
|
||||||
to_change_tal(){
|
to_change_tal(){
|
||||||
|
if(smc.vmdata.mission_data.refresh_count<=0) return
|
||||||
|
smc.vmdata.mission_data.refresh_count--
|
||||||
console.log("[TalsComp]:to_change_tal")
|
console.log("[TalsComp]:to_change_tal")
|
||||||
if(this.cur_tal=="") return
|
if(this.cur_tal=="") return
|
||||||
oops.message.dispatchEvent(GameEvent.TalentSelect,{slot:this.cur_tal})
|
oops.message.dispatchEvent(GameEvent.TalentSelect,{slot:this.cur_tal})
|
||||||
|
|||||||
Reference in New Issue
Block a user