金币经验掉落

This commit is contained in:
2025-08-19 22:30:59 +08:00
parent 854affeaae
commit c47ecc21e6
12 changed files with 1809 additions and 462 deletions

View File

@@ -14,6 +14,7 @@ import { FightSet, getExpDrops, getStoneDrops, TooltipTypes } from "../common/co
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
import { EnhancementType } from "../common/config/LevelUp";
import { MonsterDropManager } from "../common/config/Items";
import { HeroInfo } from "../common/config/heroSet";
const { ccclass, property } = _decorator;
@@ -255,10 +256,7 @@ export class HeroViewComp extends CCComp {
this.is_count_dead=true
if(this.fac==FacSet.MON){
this.scheduleOnce(()=>{
let drop_item=this.do_drop()
if(drop_item.length>0){
oops.message.dispatchEvent(GameEvent.MonDead,{mon_uuid:this.hero_uuid,drops:drop_item})
}
this.do_drop()
},0.1)
}
if(this.fac==FacSet.HERO){
@@ -276,8 +274,24 @@ export class HeroViewComp extends CCComp {
}
do_drop(){
let drop_item=MonsterDropManager.calculateMonsterDrops(this.hero_uuid,smc.data.mission,1)
console.log("[HeroViewComp]:do_drop",this.hero_uuid,drop_item)
return drop_item
let {exp,gold,diamond}=MonsterDropManager.calculateBaseResourceDrops(HeroInfo[this.hero_uuid].quality,smc.data.mission,this.BUFFS.length)
oops.message.dispatchEvent(GameEvent.MonDead,{mon_uuid:this.hero_uuid,drops:drop_item,game_data:{exp:exp, gold:gold, diamond:diamond}})
if(drop_item.length>0){
for(let i=0;i<drop_item.length;i++){
let d_item=drop_item[i]
smc.addItem(d_item.item_uuid,d_item.count)
}
}
if(exp>0){
smc.addExp(exp)
}
if(gold>0){
smc.addGold(gold)
}
if(diamond>0){
smc.addDiamond(diamond)
}
console.log("[HeroViewComp]:do_drop",this.hero_uuid,drop_item,exp,gold,diamond)
}
add_debuff(type:number,deV:number,deC:number,deR:number){
let n_deR=deR-this.Attrs[BuffAttr.DEBUFF_DOWN]