金币系统

This commit is contained in:
2025-05-30 10:34:18 +08:00
parent 564b3e2de9
commit 96db3dc1bd
10 changed files with 2261 additions and 107 deletions

View File

@@ -3,6 +3,9 @@
"__type__": "cc.AnimationClip",
"_name": "notify",
"_objFlags": 0,
"__editorExtras__": {
"embeddedPlayerGroups": []
},
"_native": "",
"sample": 60,
"speed": 1,
@@ -21,8 +24,13 @@
"__id__": 23
}
],
"_exoticAnimation": null,
"_events": [],
"_exoticAnimation": null
"_embeddedPlayers": [],
"_additiveSettings": {
"__id__": 34
},
"_auxiliaryCurveEntries": []
},
{
"__type__": "cc.animation.VectorTrack",
@@ -30,7 +38,8 @@
"__type__": "cc.animation.TrackBinding",
"path": {
"__id__": 2
}
},
"proxy": null
},
"_channels": [
{
@@ -64,7 +73,7 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.8333333333333334,
0.8333333134651184,
1.25
],
"_values": [
@@ -77,7 +86,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -88,7 +98,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -99,7 +110,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
@@ -115,7 +127,7 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.8333333333333334,
0.8333333134651184,
1.25
],
"_values": [
@@ -123,34 +135,37 @@
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"value": 400,
"rightTangent": 0,
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"value": 400,
"rightTangent": 0,
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 300,
"value": 700,
"rightTangent": 0,
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
@@ -166,7 +181,7 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.8333333333333334,
0.8333333134651184,
1.25
],
"_values": [
@@ -179,7 +194,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -190,7 +206,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -201,7 +218,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
@@ -226,7 +244,8 @@
"__type__": "cc.animation.TrackBinding",
"path": {
"__id__": 12
}
},
"proxy": null
},
"_channels": [
{
@@ -273,7 +292,7 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.8333333333333334,
0.8333333134651184,
1.25
],
"_values": [
@@ -286,7 +305,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -297,7 +317,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -308,7 +329,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
@@ -324,7 +346,7 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.8333333333333334,
0.8333333134651184,
1.25
],
"_values": [
@@ -337,7 +359,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -348,7 +371,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -359,7 +383,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
@@ -375,7 +400,7 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.8333333333333334,
0.8333333134651184,
1.25
],
"_values": [
@@ -388,7 +413,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -399,7 +425,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -410,7 +437,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
@@ -426,7 +454,7 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.8333333333333334,
0.8333333134651184,
1.25
],
"_values": [
@@ -439,7 +467,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -450,7 +479,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -461,7 +491,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
@@ -473,7 +504,8 @@
"__type__": "cc.animation.TrackBinding",
"path": {
"__id__": 24
}
},
"proxy": null
},
"_channels": [
{
@@ -513,7 +545,7 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.8333333333333334,
0.8333333134651184,
1.25
],
"_values": [
@@ -526,7 +558,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -537,7 +570,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -548,7 +582,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
@@ -564,7 +599,7 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.8333333333333334,
0.8333333134651184,
1.25
],
"_values": [
@@ -577,7 +612,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -588,7 +624,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -599,7 +636,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
@@ -615,7 +653,7 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.8333333333333334,
0.8333333134651184,
1.25
],
"_values": [
@@ -628,7 +666,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -639,7 +678,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -650,7 +690,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
@@ -666,7 +707,7 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.8333333333333334,
0.8333333134651184,
1.25
],
"_values": [
@@ -679,7 +720,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -690,7 +732,8 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
@@ -701,10 +744,16 @@
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.AnimationClipAdditiveSettings",
"enabled": false,
"refClip": null
}
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "766e69d3-f7bc-4ce2-a413-b3c0d99220ae",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "toast"
}
}

View File

@@ -45,6 +45,8 @@ export class SingletonModuleComp extends ecs.Comp {
gold:10,//金币
refresh_gold:1,//刷新金币
call_gold:3,//召唤金币
add_gold:1,//金币增加
change_gold:1,//金币变化
exp:0,//经验
skp:0,//技能点
box:0,//宝箱

View File

@@ -20,6 +20,8 @@ export enum UIID {
ItemInfo,
/**物品 */
Victory,
// /** 提示窗 */
// Toast,
}
/** 打开界面方式的配置数据 */
@@ -30,4 +32,5 @@ export var UIConfigData: { [key: number]: UIConfig } = {
[UIID.Role_Controller]: { layer: LayerType.UI, prefab: "gui/role_controller" },
[UIID.ItemInfo]: { layer: LayerType.Dialog, prefab: "gui/element/item_info" },
[UIID.Victory]: { layer: LayerType.Dialog, prefab: "gui/element/victory" },
// [UIID.Toast]: { layer: LayerType.PopUp, prefab: "common/prefab/toast" },
}

View File

@@ -0,0 +1,22 @@
import { _decorator, Component, Node } from 'cc';
import { oops } from 'db://oops-framework/core/Oops';
const { ccclass, property } = _decorator;
@ccclass('stoast')
export class stoast extends Component {
onAdded(args: any) {
console.log("toast打开",args)
}
private close() {
oops.gui.removeByNode(this.node);
}
onDestroy() {
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "d26fa84f-22b4-4136-bb46-d7e978683365",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -7,6 +7,7 @@ import { RandomManager } from "db://oops-framework/core/common/random/RandomMana
import { oops } from "db://oops-framework/core/Oops";
import { HeroModelComp } from "../hero/HeroModelComp";
import { HeroViewComp } from "../hero/HeroViewComp";
import { smc } from "../common/SingletonModuleComp";
const { ccclass, property } = _decorator;
@@ -34,7 +35,7 @@ export class CardComp extends CCComp {
}
mission_end(){
}
onCardRefresh(event: string, args: any){
this.is_used=false
@@ -80,10 +81,16 @@ export class CardComp extends CCComp {
return "召唤"
}
use_card(){
if(this.is_used) return
switch(this.c_type){
case 0:
if(smc.vmdata.mission_data.gold< smc.vmdata.mission_data.call_gold){
oops.gui.toast("金币不足", false);
return
}
oops.message.dispatchEvent(GameEvent.UseHeroCard,{uuid:this.c_uuid})
smc.vmdata.mission_data.gold-=smc.vmdata.mission_data.call_gold
break
case 1:
oops.message.dispatchEvent(GameEvent.UseSkillCard,{uuid:this.c_uuid})

View File

@@ -12,6 +12,7 @@ import { HeroSkillsComp } from "../skill/heroSkillsComp";
import { HeroViewComp } from "../hero/HeroViewComp";
import { Hero } from "../hero/Hero";
import { HartModelComp } from "../hero/HartModelComp";
import { TimerManager } from "db://oops-framework/core/common/timer/TimerManager";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@@ -21,10 +22,13 @@ export class MissionComp extends CCComp {
VictoryComp:any = null;
reward:number = 0;
reward_num:number = 0;
GlodAddTimer:Timer = new Timer(1);
mission_data:any={
gold:10,//金币
refresh_gold:1,//刷新金币
call_gold:3,//召唤金币
add_gold:1,//金币增加
change_gold:1,//金币变化
exp:0,//经验
skp:0,//技能点
box:0,//宝箱
@@ -42,6 +46,9 @@ export class MissionComp extends CCComp {
if(!smc.mission.play||smc.mission.pause){
return
}
if(this.GlodAddTimer.update(dt)){
smc.vmdata.mission_data.gold+=smc.vmdata.mission_data.add_gold
}
}
@@ -70,21 +77,12 @@ export class MissionComp extends CCComp {
}
data_init(){
//局内数据初始化
this.GlodAddTimer=new Timer(1)
smc.mission.status=1
smc.mission.play = true;
smc.mission.is_victory=false
smc.mission.is_defeat=false
smc.vmdata.mission_data ={
gold:10,//金币
refresh_gold:1,//刷新金币
call_gold:3,//召唤金币
exp:0,//经验
skp:0,//技能点
box:0,//宝箱
energy:0,//能量
hp:0,//血量
ap:0,//攻击
}
smc.vmdata.mission_data ={...smc.vmdata.mission_data}
}
//角色初始化
@@ -99,7 +97,13 @@ export class MissionComp extends CCComp {
oops.message.dispatchEvent(GameEvent.CardRefresh)
}
card_refresh(){
if(smc.vmdata.mission_data.gold< smc.vmdata.mission_data.refresh_gold){
oops.gui.toast("金币不足", false);
return
}
oops.message.dispatchEvent(GameEvent.CardRefresh)
smc.vmdata.mission_data.gold-=smc.vmdata.mission_data.refresh_gold
}
private cleanComponents() {