奖励完善
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
export const HeroInfo = {
|
||||
9001: {
|
||||
uuid:9001,name: "骑士·白",path:"k1",type:1,hp: 200, hp_up:10,def:10,def_up:1,ap:20,ap_up:2,atp:1,vun:0,crit:20,crit_add:0,dodge:0,dis:100,a_cd:1,
|
||||
uuid:9001,name: "骑士·白",path:"k1",type:1,hp: 10, hp_up:10,def:10,def_up:1,ap:20,ap_up:2,atp:1,vun:0,crit:20,crit_add:0,dodge:0,dis:100,a_cd:1.5,
|
||||
lvexp:2,slvexp:2, speed: 100,aep:1,uaep:1,dep:10,sk1:[9001,9001,9001,9001,9001],sk2: [2002,2002,2002,2002,2002],pw:0,pwm:15,pws:1,
|
||||
akr:[10,20,30,40,50],akc:[1,1,1,1,1],uar:[10,20,30,40,50],uac:[1,1,1,1,1],dgr:[10,20,30,40,50],dgc:[1,1,1,1,1],crr:[10,20,30,40,50],crc:[1,1,1,1,1],
|
||||
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
|
||||
|
||||
@@ -153,7 +153,7 @@ export class HeroViewComp extends CCComp {
|
||||
if(selfCollider.group != otherCollider.group){
|
||||
let skill = otherCollider.node.getComponent(SkillCom)!;
|
||||
// console.log('onPostSolve',skill);
|
||||
this.in_atked();
|
||||
|
||||
if(this.hp <= 0 ){
|
||||
return
|
||||
}
|
||||
@@ -166,6 +166,7 @@ export class HeroViewComp extends CCComp {
|
||||
return
|
||||
}
|
||||
if(this.check_dodge()) return
|
||||
this.in_atked();
|
||||
let l_hp=(skill.ap-this.def)*-1
|
||||
if(skill.is_crit){
|
||||
l_hp = l_hp * (150+skill.crit_add)/100
|
||||
@@ -356,7 +357,8 @@ export class HeroViewComp extends CCComp {
|
||||
check_dodge(){
|
||||
let i = RandomManager.instance.getRandomInt(0,100,3)
|
||||
if(i < this.dodge){
|
||||
this.tooltip(5,"/闪避/");
|
||||
console.log("闪避触发: i="+i+":dodge="+this.dodge);
|
||||
this.tooltip(5,"闪避");
|
||||
this.dodge_count += 1
|
||||
return true
|
||||
}else{
|
||||
@@ -454,7 +456,7 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
//使用max_skill
|
||||
handle_skill(skill:number){
|
||||
this.as.atk()
|
||||
this.as.max()
|
||||
this.at = 0;
|
||||
this.tooltip(3,smc.skills[skill].name,skill);
|
||||
|
||||
|
||||
9
assets/script/game/hero/MonModelComp.ts.meta
Normal file
9
assets/script/game/hero/MonModelComp.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "118ca580-773a-458b-8544-ab6c3cb2b376",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -30,31 +30,27 @@ export class VictoryComp extends CCComp {
|
||||
private do_victiry(is_victory:boolean) {
|
||||
if(this.if_show) return
|
||||
this.getReward(is_victory)
|
||||
this.node.getChildByName("Node").getChildByName("defeat").active = is_victory
|
||||
this.node.getChildByName("Node").getChildByName("victory").active = !is_victory;
|
||||
this.node.getChildByName("Node").getChildByName("victory").active = is_victory;
|
||||
this.node.getChildByName("Node").getChildByName("defeat").active = !is_victory
|
||||
this.node.setPosition(0,this.node.position.y,0)
|
||||
}
|
||||
getReward(is_victory:boolean){
|
||||
let conut =2
|
||||
if(!is_victory) conut=1
|
||||
let conut =3
|
||||
if(!is_victory) conut=conut-1
|
||||
let item1=ecs.getEntity<Item>(Item)
|
||||
let gold: number = Math.floor(RandomManager.instance.getRandomInt((3000 + smc.vmdata.mission.lv * 100) / 3 * 2, 3000 + smc.vmdata.mission.lv * 100));
|
||||
let parent = this.node.getChildByName("Node").getChildByName("items")
|
||||
let reward:any = RandomManager.instance.getRandomByObjectList(MissionReward[this.reward_lv], conut);
|
||||
item1.load(9001,gold,parent)
|
||||
this.rewards = [];
|
||||
this.rewards[0]={uuid:9001,num:gold}
|
||||
for (let i = 0; i < conut; i++) {
|
||||
for (let x = 1; x <= conut; x++) {
|
||||
let item=ecs.getEntity<Item>(Item)
|
||||
|
||||
while (Items[reward[i]]==undefined) {
|
||||
let r = RandomManager.instance.getRandomByObjectList(MissionReward[this.reward_lv], 1);
|
||||
Items[reward[i]]=r[0]
|
||||
console.log("getReward undefined",Items[reward[i]],i)
|
||||
}
|
||||
let im =Items[reward[i]]
|
||||
let r_i:any = RandomManager.instance.getRandomInt(0,MissionReward[this.reward_lv].length);
|
||||
let ii = MissionReward[this.reward_lv][r_i];
|
||||
let im = Items[ii];
|
||||
// console.log("reward",r_i,ii,im)
|
||||
item.load(im.uuid,im.r_num,parent)
|
||||
this.rewards[i+1]={uuid:9001,num:gold}
|
||||
this.rewards[x]={uuid:im.uuid,num:im.r_num}
|
||||
}
|
||||
this.if_show=true
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "4aa9eb83-72b3-400f-8340-0ee05db5860f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ export class MSkill extends ecs.Entity {
|
||||
// this.addComponents<ecs.Comp>();
|
||||
}
|
||||
load(box_group:number=0,uuid:number=1001) {
|
||||
var path = "game/hero/mskill";
|
||||
var path = "game/heros/mskill";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
let entityLayer =smc.map.MapView.scene.entityLayer!.node!
|
||||
|
||||
Reference in New Issue
Block a user