back_recharge
zhangshanxue 2019-10-23 17:36:07 +08:00
commit bbfbfc5c9b
12 changed files with 174 additions and 107 deletions

View File

@ -1124,19 +1124,19 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
end,
--发动技能后,有[a]的概率为自身及相邻加持攻击[b]%的护盾,持续[c]秒。
--a[float],b[float],c[int]
--发动技能后,有[a]的概率为自身及相邻加持[b][c]%的护盾,持续[d]秒。
--a[float],b[属性],c[float],d[int]
[62] = function(role, args)
local f1 = args[1]
local f2 = args[2]
local f3 = args[3]
local pro = args[2]
local f2 = args[3]
local f3 = args[4]
local OnSkillCastEnd = function(skill)
BattleUtil.RandomAction(f1, function ()
role:AddBuff(Buff.Create(role, BuffName.Shield, f3, floor(role:GetRoleData(RoleDataName.Attack) * f2), 0))
local list = BattleLogic.GetNeighbor(role, 1)
for i=1, #list do
list[i]:AddBuff(Buff.Create(role, BuffName.Shield, f3, floor(role:GetRoleData(RoleDataName.Attack) * f2), 0))
list[i]:AddBuff(Buff.Create(role, BuffName.Shield, f3, floor(role:GetRoleData(propertyList[pro]) * f2), 0))
end
end)
end

View File

@ -141,17 +141,28 @@ function Skill:Cast()
end
if not self.isTeamSkill then
if self.owner.superSkill == self then
--绝技读条时间=max9-速度/8*(等级+10,3)
local time = max(9-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 3)
self.owner.sp = 0
self.owner.spPass = floor(BattleUtil.ErrorCorrection(time) * BattleLogic.GameFrameRate)
local type = BattleLogic.Type
local isPVEMonster = self.owner.camp == 1 and (type == 1 or type == 2 or type == 4 or type == 5)
local time = 0
if isPVEMonster then
if self.owner.superSkill == self then
--怪物绝技读条时间=max10-速度/8*(等级+10,2)
time = max(10-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 2)
else
--怪物普技读条时间==max9-速度/8*(等级+10,1)
time = max(9-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 1)
end
else
--普技读条时间=max7-速度/8*(等级+10,1.5)
local time = max(7-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 1.5)
self.owner.sp = 0
self.owner.spPass = floor(BattleUtil.ErrorCorrection(time) * BattleLogic.GameFrameRate)
if self.owner.superSkill == self then
--绝技读条时间=max9-速度/8*(等级+10,3)
time = max(9-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 3)
else
--普技读条时间=max7-速度/8*(等级+10,1.5)
time = max(7-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 1.5)
end
end
self.owner.sp = 0
self.owner.spPass = floor(BattleUtil.ErrorCorrection(time) * BattleLogic.GameFrameRate)
else
self.owner.curSkill = self
end

View File

@ -9,9 +9,6 @@ local curUid
local curBuffId
local curFrame
local playerMP
local enemyMP
local playerSkillUsable
local enemySkillUsable

View File

@ -230,6 +230,7 @@ function BattleUtil.CalDamage(atkRole, defRole, damageType, baseFactor, ignoreDe
local baseDamage
ignoreDef = 1 - (ignoreDef or 0)
bCrit = Random.Range01() <= clamp(atkRole:GetRoleData(RoleDataName.Crit)-defRole:GetRoleData(RoleDataName.Tenacity), 0, 1)
bCrit = bCrit or defRole.isFlagCrit == true
local defence = 0
if damageType == 1 then --1 物理 2 魔法
defence = defRole:GetRoleData(RoleDataName.PhysicalDefence)
@ -238,7 +239,7 @@ function BattleUtil.CalDamage(atkRole, defRole, damageType, baseFactor, ignoreDe
end
local attack = atkRole:GetRoleData(RoleDataName.Attack)
--计算暴击
if bCrit or defRole.isFlagCrit then
if bCrit then
local critDamageFactor = atkRole:GetRoleData(RoleDataName.CritDamageFactor)
--加入被动效果
local critFunc = function(critEx) critDamageFactor = critEx end
@ -267,7 +268,15 @@ function BattleUtil.CalDamage(atkRole, defRole, damageType, baseFactor, ignoreDe
baseDamage = BattleUtil.FP_Mul(baseDamage, baseFactor,
1 + atkRole:GetRoleData(RoleDataName.DamageBocusFactor) - defRole:GetRoleData(RoleDataName.DamageReduceFactor),
(1 + atkRole:GetRoleData(RoleDataName.ElementDamageBocusFactor) - defRole:GetRoleData(elementDamageReduceFactor)))
baseDamage = floor(max(baseDamage, 0.1 * attack))
--属性克制关系:光暗互克,地克风克水克火克地
local restrain = atkRole.element == 1 and defRole.element == 4 or
atkRole.element == 4 and defRole.element == 2 or
atkRole.element == 2 and defRole.element == 3 or
atkRole.element == 3 and defRole.element == 1 or
atkRole.element == 5 and defRole.element == 6 or
atkRole.element == 6 and defRole.element == 5
baseDamage = restrain and floor(max(baseDamage*1.5, 0.1*attack)) or floor(max(baseDamage, 0.1*attack))
for i=1, atkRole.exCalDmgList.size do
local func = atkRole.exCalDmgList.buffer[i]

View File

@ -141,6 +141,7 @@ public class GMRequestHandler extends BaseHandler{
break;
}
}
break;
case GlobalGm.ADOPT_FIGHT_BY_VALUE:
int fightId = cUser.getMainLevelManager().getFightId();
if(SMainLevelConfig.biggerThanFight(fightId,prarm1)){

View File

@ -1203,7 +1203,10 @@ public class MapLogic {
}
int groupId = option[0];
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
groupId =STableManager.getFigureConfig(MapStaticConfig.class).getDifficultyMonster().get(groupId);
Integer newGroupId= STableManager.getFigureConfig(MapStaticConfig.class).getDifficultyMonster().get(groupId);
if(newGroupId!=null){
groupId = newGroupId;
}
}
int destoryXY = mapManager.getTriggerXY();
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(user, mapManager.getTeamId(), true);
@ -1244,14 +1247,13 @@ public class MapLogic {
if (resultCode == 0) {
//todo 无尽副本不复活记得改回去
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
// //无尽副本复活消耗
// //无尽副本复活消耗
reviveConsumeExecution(user);
}
// for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){
// mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0);
// mapManager.updateEndlessHeroHp(entry.getKey(),0);
// }
// }else {
for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){
mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0);
mapManager.updateEndlessHeroHp(entry.getKey(),0);
}
}else {
// 失败需要等待n秒后复活所有英雄
int dieCount = user.getMapManager().getDieCount();
dieCount++;
@ -1275,7 +1277,7 @@ public class MapLogic {
remainHp.add(heroAttributeMap.get(HeroAttributeEnum.CurHP.getPropertyId()));
}
}
// }
}
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
FightInfoProto.FastFightResponse build = FightInfoProto.FastFightResponse
.newBuilder()
@ -1473,67 +1475,67 @@ public class MapLogic {
mapManager.setLastFightResult(resultCode);
if (resultCode == 0 || dropout == 1) {
//todo 无尽副本复活
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4){
if (SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType() == 4) {
//无尽副本复活消耗
reviveConsumeExecution(user);
// for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){
// mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0);
// mapManager.updateEndlessHeroHp(entry.getKey(),0);
// }
}
// else{
// 失败需要等待n秒后复活所有英雄
int dieCount = user.getMapManager().getDieCount();
dieCount++;
user.getMapManager().setDieCount(dieCount);
int[] reviveTime = sChallengeConfig.getReviveTime();
long time = (long) (MathUtils.calABX(dieCount, reviveTime) * 1000);
user.getMapManager().setCanMoveTime(TimeUtils.now() + time);
int leftTime = getLeftTime(user, true);
remainHp.clear();
if (leftTime <= (int) (time / 1000)) {
resetMapInfo(user, false);
for (Map.Entry<String, Map<Integer, Integer>> entry : mapManager.getHeroAllAttributeMap().entrySet()) {
mapManager.updateHeroOneAttribute(entry.getKey(), HeroAttributeEnum.CurHP.getPropertyId(), 0);
mapManager.updateEndlessHeroHp(entry.getKey(), 0);
}
} else {
initTeamInfo(mapManager.getTeamId(), uid, user, mapManager,2);
Map<String, Map<Integer, Integer>> heroAllAttributeMap = mapManager.getHeroAllAttributeMap();
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(mapManager.getTeamId());
for (TeamPosHeroInfo heroInfo : teamPosHeroInfos) {
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
if (hero == null) {
continue;
// 失败需要等待n秒后复活所有英雄
int dieCount = user.getMapManager().getDieCount();
dieCount++;
user.getMapManager().setDieCount(dieCount);
int[] reviveTime = sChallengeConfig.getReviveTime();
long time = (long) (MathUtils.calABX(dieCount, reviveTime) * 1000);
user.getMapManager().setCanMoveTime(TimeUtils.now() + time);
int leftTime = getLeftTime(user, true);
remainHp.clear();
if (leftTime <= (int) (time / 1000)) {
resetMapInfo(user, false);
} else {
initTeamInfo(mapManager.getTeamId(), uid, user, mapManager, 2);
Map<String, Map<Integer, Integer>> heroAllAttributeMap = mapManager.getHeroAllAttributeMap();
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(mapManager.getTeamId());
for (TeamPosHeroInfo heroInfo : teamPosHeroInfos) {
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
if (hero == null) {
continue;
}
remainHp.add(heroAllAttributeMap.get(hero.getId()).get(HeroAttributeEnum.CurHP.getPropertyId()));
}
remainHp.add(heroAllAttributeMap.get(hero.getId()).get(HeroAttributeEnum.CurHP.getPropertyId()));
}
}
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
FightInfoProto.FightEndResponse.Builder fightEndResponse = FightInfoProto.FightEndResponse
.newBuilder();
fightEndResponse.setResult(resultCode);
fightEndResponse.setEnventDrop(dropBuilder);
fightEndResponse.addAllRemainHpList(remainHp);
fightEndResponse.setLastXY(mapManager.getLastXY());
mapManager.setCurXY(mapManager.getLastXY());
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==2){
fightEndResponse.setLastTowerTime((int)(mapManager.getCurrTowerTime()/1000));
}
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
FightInfoProto.FightEndResponse.Builder fightEndResponse = FightInfoProto.FightEndResponse
.newBuilder();
fightEndResponse.setResult(resultCode);
fightEndResponse.setEnventDrop(dropBuilder);
fightEndResponse.addAllRemainHpList(remainHp);
fightEndResponse.setLastXY(mapManager.getLastXY());
mapManager.setCurXY(mapManager.getLastXY());
if (SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType() == 2) {
fightEndResponse.setLastTowerTime((int) (mapManager.getCurrTowerTime() / 1000));
}
if(sOptionConfig!=null){
int[][] jumpTypeValues = sOptionConfig.getJumpTypeValues();
if(jumpTypeValues.length>0 && sOptionConfig.getJumpType() == 3){
SOptionAddCondition sOptionAddConditions = SOptionAddCondition.sOptionAddConditionMap.get(jumpTypeValues[1][1]);
if(sOptionAddConditions!=null && sOptionAddConditions.getType() == 7){
Cell cell = mapManager.getMapInfo().get(triggerXY);
if (cell != null ) {
nextEventId = getNextEventId(user, cell, sOptionConfig);
cell.setEventId(nextEventId);
mapManager.addOrUpdateCell(triggerXY, cell);
fightEndResponse.setEventId(nextEventId);
if (sOptionConfig != null) {
int[][] jumpTypeValues = sOptionConfig.getJumpTypeValues();
if (jumpTypeValues.length > 0 && sOptionConfig.getJumpType() == 3) {
SOptionAddCondition sOptionAddConditions = SOptionAddCondition.sOptionAddConditionMap.get(jumpTypeValues[1][1]);
if (sOptionAddConditions != null && sOptionAddConditions.getType() == 7) {
Cell cell = mapManager.getMapInfo().get(triggerXY);
if (cell != null) {
nextEventId = getNextEventId(user, cell, sOptionConfig);
cell.setEventId(nextEventId);
mapManager.addOrUpdateCell(triggerXY, cell);
fightEndResponse.setEventId(nextEventId);
}
}
}
}
}
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
return;
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
return;
}
for (int i = 2; i < checkResult.length; i++) {
if (checkResult[i] <= 0) {
@ -1546,13 +1548,14 @@ public class MapLogic {
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(teamId);
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4&&teamId==401){
mapManager.updateEndlessFightCount(mapManager.getEndlessMapInfo().getFightCount()+1);
for (int i = 0 ; i <team.size();i++) {
Hero hero = user.getHeroManager().getHero(team.get(i).getHeroId());
Map<Integer, Integer> heroAllAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero,false,teamId);
int per =(int) (checkResult[i+2] / (double) heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())*10000);
mapManager.updateEndlessHeroHp(team.get(i).getHeroId(),per);
mapManager.updateHeroOneAttribute(team.get(i).getHeroId(), HeroAttributeEnum.CurHP.getPropertyId(), checkResult[i+2]);
if(checkResult[0]>0){
for (int i = 0 ; i <team.size();i++) {
Hero hero = user.getHeroManager().getHero(team.get(i).getHeroId());
Map<Integer, Integer> heroAllAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero,false,teamId);
int per =(int) (checkResult[i+2] / (double) heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())*10000);
mapManager.updateEndlessHeroHp(team.get(i).getHeroId(),per);
mapManager.updateHeroOneAttribute(team.get(i).getHeroId(), HeroAttributeEnum.CurHP.getPropertyId(), checkResult[i+2]);
}
}
// if(!cacheRemove.isEmpty()){
// Iterator<TeamPosHeroInfo> iterator = team.iterator();

View File

@ -386,7 +386,7 @@ public class GlobalDataManaager {
}
int size = (int)(users.size()*0.85);
if(size ==0){
return -1;
return 1;
}
int level = 0;
for(int i = 0 ; i <size;i++){

View File

@ -77,8 +77,8 @@ public class MainLevelManager extends MongoBase {
this.lastTime = now;
}else{
int adventureRefresh = gameSetting.getAdventureRefresh();
this.startTime = startTime+hadTakeTimes*adventureRefresh;
this.lastTime = lastTime+lastTakes*adventureRefresh;
this.startTime = lastTime;
}
updateString("lastTime",state);

View File

@ -834,6 +834,17 @@ public class GuildFightLogic {
if(zsetreverseRangeWithScores.size()<1){
continue;
}
Map<Integer, Integer> defendInfo = guildInfo.getDefendInfo();
String particapateReward = SGuildSetting.sGuildSetting.getParticipation();
for(Integer uid:defendInfo.keySet()){
Integer attackCount = redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_ATTACK_COUNT,"",String.valueOf(uid),Integer.class);
if(attackCount!=null&&attackCount>0){
continue;
}
String title = SErrorCodeEerverConfig.getI18NMessage("family_fight_reward_title");
String content = SErrorCodeEerverConfig.getI18NMessage("family_fight_reward_txt");
MailLogic.getInstance().sendMail(uid,title,content,particapateReward,(int) (TimeUtils.now()/1000), Global.MAIL_EFFECTIVE_TIME);
}
Iterator<ZSetOperations.TypedTuple<String>> it = zsetreverseRangeWithScores.iterator();
int userRank = 0;
int userResultRank = 0;

View File

@ -252,14 +252,6 @@ public class CombatLogic {
}
int fightId = mainLevelManager.getFightId();
SMainLevelConfig targetMainLevelConfig = SMainLevelConfig.config.get(fightId);
if(mainLevelManager.getState()==-1){
for( SMainLevelConfig sMainLevelConfig : SMainLevelConfig.config.values() ){
if(sMainLevelConfig.getNextLevel() == mainLevelManager.getFightId()){
targetMainLevelConfig = sMainLevelConfig;
break;
}
}
}
int lastTime = mainLevelManager.getLastTime();
int now = (int) (System.currentTimeMillis() / 1000);
int times = (now - lastTime)/STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getAdventureRefresh();

View File

@ -37,6 +37,7 @@ import util.TimeUtils;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;
public class ItemUtil {
private static Map<Integer,String> dropRewardMap = new ConcurrentHashMap<>();
@ -918,6 +919,24 @@ public class ItemUtil {
StringBuilder reward = new StringBuilder();
List<CommonProto.Equip> equipList = new CopyOnWriteArrayList<>();
List<CommonProto.Equip> especialEquip = new CopyOnWriteArrayList<>();
int limit = SSpecialConfig.getIntegerValue(SSpecialConfig.EquipTalismana_limit);
if(equipMap.entrySet().stream().filter(k ->{
int itemType = SItem.getsItemMap().get(k.getKey()).getItemType();
if(itemType==GlobalItemType.ESPECIAL_EQUIP){
return true;
}
return false;
}).collect(Collectors.toSet()).size()>0){
if (user.getEquipManager().getEspecialEquipMap().size() >=limit){
String bagTitle = SErrorCodeEerverConfig.getI18NMessage("EquipTalismana_bag_limit_title");
String bagContent = SErrorCodeEerverConfig.getI18NMessage("EquipTalismana_bag_limit_txt");
String bagReward = getLimitReward(equipMap,filter);
int nowTime =(int) (TimeUtils.now()/1000);
MailLogic.getInstance().sendMail(user.getId(),bagTitle,bagContent,bagReward,nowTime,Global.MAIL_EFFECTIVE_TIME);
MessageUtil.nofityBagIsFull(user);
return;
}
}
for (Map.Entry<Integer, Integer> entry : equipMap.entrySet()) {
int itemType = SItem.getsItemMap().get(entry.getKey()).getItemType();
if(!filter.contains(itemType)){
@ -955,17 +974,35 @@ public class ItemUtil {
List<CommonProto.Equip> equipList = new CopyOnWriteArrayList<>();
List<Integer> filter = new ArrayList<>();
filter.add(GlobalItemType.SOUL_MARK);
int limit = SSpecialConfig.getIntegerValue(SSpecialConfig.EQUIPSIGN_LIMIT);
if (user.getEquipManager().getSoulEquipMap().size() >=limit){
String title = SErrorCodeEerverConfig.getI18NMessage("EquipSign_bag_limit_title");
String content = SErrorCodeEerverConfig.getI18NMessage("EquipSign_bag_limit_txt");
String reward = getLimitReward(equipMap,filter);
int nowTime =(int) (TimeUtils.now()/1000);
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,nowTime,Global.MAIL_EFFECTIVE_TIME);
MessageUtil.nofityBagIsFull(user);
return;
}
// int limit = SSpecialConfig.getIntegerValue(SSpecialConfig.EQUIPSIGN_LIMIT);
// if (user.getEquipManager().getSoulEquipMap().size() >=limit){
// String title = SErrorCodeEerverConfig.getI18NMessage("EquipSign_bag_limit_title");
// String content = SErrorCodeEerverConfig.getI18NMessage("EquipSign_bag_limit_txt");
// String reward = getLimitReward(equipMap,filter);
// int nowTime =(int) (TimeUtils.now()/1000);
// MailLogic.getInstance().sendMail(user.getId(),title,content,reward,nowTime,Global.MAIL_EFFECTIVE_TIME);
// MessageUtil.nofityBagIsFull(user);
// return;
// }
if(equipMap.entrySet().stream().filter(k ->{
int itemType = SItem.getsItemMap().get(k.getKey()).getItemType();
if(itemType==GlobalItemType.SOUL_MARK){
return true;
}
return false;
}).collect(Collectors.toSet()).size()>0){
int limit = SSpecialConfig.getIntegerValue(SSpecialConfig.EQUIPSIGN_LIMIT);
if (user.getEquipManager().getSoulEquipMap().size() >=limit){
String title = SErrorCodeEerverConfig.getI18NMessage("EquipSign_bag_limit_title");
String content = SErrorCodeEerverConfig.getI18NMessage("EquipSign_bag_limit_txt");
String reward = getLimitReward(equipMap,filter);
int nowTime =(int) (TimeUtils.now()/1000);
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,nowTime,Global.MAIL_EFFECTIVE_TIME);
MessageUtil.nofityBagIsFull(user);
return;
}
}
for (Map.Entry<Integer, Integer> entry : equipMap.entrySet()) {
int itemType = SItem.getsItemMap().get(entry.getKey()).getItemType();
if(itemType!=GlobalItemType.SOUL_MARK){

View File

@ -62,6 +62,8 @@ public class SGuildSetting implements BaseConfig {
private int recruitCD;
private String participation;
public static SGuildSetting sGuildSetting;
@ -183,4 +185,8 @@ public class SGuildSetting implements BaseConfig {
public int getRecruitCD() {
return recruitCD;
}
public String getParticipation() {
return participation;
}
}