【ID1005236】

【异妖配件属性修改】
back_recharge
zhangshanxue 2019-12-07 17:25:11 +08:00
parent 460d47c20a
commit e9833d8142
3 changed files with 82 additions and 3 deletions

View File

@ -0,0 +1,28 @@
package com.ljsd.jieling.kefu;
import com.google.gson.Gson;
import manager.STableManager;
public class Cmd_out_cfg extends GmAbstract {
@Override
public boolean exec(String[] args) throws Exception {
try {
if(args.length!=2){
return false;
}
String name = args[0];
int id = Integer.valueOf(args[1]);
if(!STableManager.getConfig(Class.forName(name)).containsKey(id)){
System.out.print("--systemConfig-id not found");
return false;
}
Gson gson = new Gson();
System.out.print("--Config-"+name+"::"+gson.toJson(STableManager.getConfig(Class.forName(name)).get(id)));
return true;
}catch (Exception e){
e.printStackTrace();
}
return false;
}
}

View File

@ -25,7 +25,7 @@ class RechargeSumDayActivity extends AbstractActivity {
return;
}
int missionId = STableManager.getFigureConfig(ActivityStaticConfig.class).getRechargeDaySum().get(activityMission.getValue() + 1);
if (user.getPlayerInfoManager().getRechargedaily() > SActivityRewardConfig.getsActivityRewardConfigByMissionId(missionId).getValues()[0][0]) {
if (user.getPlayerInfoManager().getRechargedaily() >= SActivityRewardConfig.getsActivityRewardConfigByMissionId(missionId).getValues()[0][0]) {
activityMission.setValue(activityMission.getValue() + 1);
}
}
@ -38,7 +38,7 @@ class RechargeSumDayActivity extends AbstractActivity {
if (activityProgressInfo == null || activityProgressInfo.getProgrss() == 1) {
return;
}
if (count > activityProgressInfo.getProgrss()) {
if (count >= SActivityRewardConfig.getsActivityRewardConfigByMissionId(missionId).getValues()[0][0]) {
activityProgressInfo.setProgrss(1);
}

View File

@ -47,7 +47,8 @@ public class Equip extends PropertyItem implements Cloneable{
int secondNumMin = sEquipConfig.getSecondNumMin();
int secondNumMax = sEquipConfig.getSecondNumMax();
int secondValue = MathUtils.random(secondNumMin, secondNumMax);
Map<Integer, Integer> secondValueByIdMap = getSecondValue(sEquipConfig.getPool(), secondValue,promoteMap);
List<Integer> poolIds = MathUtils.randomForOneArray(sEquipConfig.getPool(),secondValue);
Map<Integer, Integer> secondValueByIdMap = getSecondValue(poolIds,promoteMap);
super.setSecondValueByIdMap(secondValueByIdMap);
super.setCreateTime((int)(TimeUtils.now()/1000));
//skill库随机
@ -140,7 +141,57 @@ public class Equip extends PropertyItem implements Cloneable{
}
}
private Map<Integer,Integer> getSecondValue(List<Integer> poolId,Map<Integer, Integer> promoteMap) {
Map<Integer,Integer> result = new HashMap<>();
for(Integer pid:poolId){
SEquipPropertyPool sEquipPropertyPool = getCfg(pid);
if(null==sEquipPropertyPool)
{
continue;
}
Integer propertyPromote = promoteMap.get(sEquipPropertyPool.getPropertyId());
if(propertyPromote == null){
propertyPromote = 0;
}
int random = MathUtils.random(sEquipPropertyPool.getMin() * (100 + propertyPromote) / 100, sEquipPropertyPool.getMax()* (100 + propertyPromote) / 100);
result.put(sEquipPropertyPool.getPropertyId(),random);
}
return result;
}
private SEquipPropertyPool getCfg(int poolId){
List<SEquipPropertyPool> sEquipPropertyPoolList = SEquipPropertyPool.getSEquipPropertyPool(poolId);
if(sEquipPropertyPoolList.size()<=0){
LOGGER.error("the equip config is wrong,the equipTid={},the poolId={},the poolNum={},the requireNum={}",super.getEquipId(),poolId,sEquipPropertyPoolList.size());
return null;
}
int totalWeight = 0;
for(SEquipPropertyPool sEquipPropertyPool : sEquipPropertyPoolList){
int weight = sEquipPropertyPool.getWeight();
if(weight == GlobalsDef.MUST_BE){
return sEquipPropertyPool;
}
totalWeight+=sEquipPropertyPool.getWeight();
}
int weight = 0;
int randomWeight = MathUtils.randomInt(totalWeight) +1;
for(SEquipPropertyPool sEquipPropertyPool : sEquipPropertyPoolList){
int weightTmp= sEquipPropertyPool.getWeight();
if(weightTmp<0){
continue;
}
weight+=weightTmp;
if(randomWeight<=weight){
return sEquipPropertyPool;
}
}
return null;
}
private Map<Integer,Integer> getSecondValue(int[] poolId,int nums,Map<Integer, Integer> promoteMap){
Map<Integer,Integer> result = new HashMap<>();
List<SEquipPropertyPool> sEquipPropertyPoolList = new ArrayList<>();
for(Integer pid:poolId){