机器人类
parent
129b9ed2ac
commit
c99f1bea67
|
@ -103,7 +103,7 @@ public class BloodLogic {
|
|||
}
|
||||
public CommonProto.FightTeamInfo fightDataMakeUp(Map<String ,String> heroSkills ,Map<String, FamilyHeroInfo> heroInfo,String pokmanSkill,String passiveSkill,Map<String,Double> remainHp,int uid) throws Exception {
|
||||
List<CommonProto.FightUnitInfo> heroDefendFightInfos = new ArrayList<>();
|
||||
int index=0;
|
||||
// int index=0;
|
||||
for (Map.Entry<String, FamilyHeroInfo> entry : heroInfo.entrySet()) {
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
String heroSkill = heroSkills.get(entry.getKey());
|
||||
|
@ -127,6 +127,8 @@ public class BloodLogic {
|
|||
User user = UserManager.getUser(uid, true);
|
||||
if(user!=null&&!user.getPokemonManager().getPokemonTeamMap().isEmpty()){
|
||||
pokemonSkills = HeroLogic.getInstance().getPokemonSkills(UserManager.getUser(uid));
|
||||
}else {
|
||||
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
|
|
|
@ -17,9 +17,13 @@ import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
|||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.fight.robot.RobotInfo;
|
||||
import com.ljsd.jieling.logic.fight.specialparm.SpecialForTeamBuildEnum;
|
||||
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import config.SRobotProperty;
|
||||
import config.SRobotSkill;
|
||||
import manager.STableManager;
|
||||
import rpc.protocols.CommonProto;
|
||||
import com.ljsd.jieling.util.FightDataUtil;
|
||||
import com.ljsd.jieling.util.MonsterUtil;
|
||||
|
@ -479,4 +483,23 @@ public class FightUtil {
|
|||
+ System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建机器人
|
||||
* @param heroTid
|
||||
* @param level
|
||||
* @return
|
||||
*/
|
||||
public static RobotInfo createRobot(int heroTid, int level){
|
||||
RobotInfo robotInfo = new RobotInfo();
|
||||
robotInfo.setHeroTid(heroTid);
|
||||
// 获取对应等级的机器人信息
|
||||
SRobotProperty property = STableManager.getConfig(SRobotProperty.class).get(level);
|
||||
robotInfo.setLevel(level);
|
||||
robotInfo.setStar(property.getStar());
|
||||
robotInfo.setRobotHeroAttribute(HeroLogic.getInstance().calRobotHeroAttribute(property));
|
||||
robotInfo.setSkill(SRobotSkill.getSkill(heroTid));
|
||||
robotInfo.setPassiveSkill(SRobotSkill.getPassiveSkill(heroTid,property.getSkillPool()-1));
|
||||
return robotInfo;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
package com.ljsd.jieling.logic.fight.robot;
|
||||
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import config.SRobotProperty;
|
||||
import config.SRobotSkill;
|
||||
import manager.STableManager;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 机器人类
|
||||
*/
|
||||
public class RobotInfo {
|
||||
private int heroTid;
|
||||
private int level;
|
||||
private int star;
|
||||
private Map<Integer, Integer> robotHeroAttribute;
|
||||
private String skill;
|
||||
private String passiveSkill;
|
||||
|
||||
public int getHeroTid() {
|
||||
return heroTid;
|
||||
}
|
||||
|
||||
public void setHeroTid(int heroTid) {
|
||||
this.heroTid = heroTid;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getStar() {
|
||||
return star;
|
||||
}
|
||||
|
||||
public void setStar(int star) {
|
||||
this.star = star;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getRobotHeroAttribute() {
|
||||
return robotHeroAttribute;
|
||||
}
|
||||
|
||||
public void setRobotHeroAttribute(Map<Integer, Integer> robotHeroAttribute) {
|
||||
this.robotHeroAttribute = robotHeroAttribute;
|
||||
}
|
||||
|
||||
public String getSkill() {
|
||||
return skill;
|
||||
}
|
||||
|
||||
public void setSkill(String skill) {
|
||||
this.skill = skill;
|
||||
}
|
||||
|
||||
public String getPassiveSkill() {
|
||||
return passiveSkill;
|
||||
}
|
||||
|
||||
public void setPassiveSkill(String passiveSkill) {
|
||||
this.passiveSkill = passiveSkill;
|
||||
}
|
||||
}
|
|
@ -58,6 +58,8 @@ public class SCHero implements BaseConfig{
|
|||
|
||||
private int job;
|
||||
|
||||
private int maxLevel;
|
||||
|
||||
private Map<Integer,Integer> secondaryFactorMap;
|
||||
|
||||
private Map<Integer, List<Integer>> skillListByStar;
|
||||
|
@ -342,4 +344,8 @@ public class SCHero implements BaseConfig{
|
|||
public int getJob() {
|
||||
return job;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return maxLevel;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ public class SExpeditionHolyConfig implements BaseConfig {
|
|||
private int canRepeat;
|
||||
// 专属英雄id,0表示没有
|
||||
private int heroId;
|
||||
|
||||
private int[] skillModify;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
@ -60,4 +62,8 @@ public class SExpeditionHolyConfig implements BaseConfig {
|
|||
public int getHeroId() {
|
||||
return heroId;
|
||||
}
|
||||
|
||||
public int[] getSkillModify() {
|
||||
return skillModify;
|
||||
}
|
||||
}
|
|
@ -33,6 +33,7 @@ public class SExpeditionSetting implements BaseConfig {
|
|||
|
||||
private int recruitTime;
|
||||
|
||||
private int[][] playerLevelfix;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
@ -96,5 +97,7 @@ public class SExpeditionSetting implements BaseConfig {
|
|||
return recruitTime;
|
||||
}
|
||||
|
||||
|
||||
public int[][] getPlayerLevelfix() {
|
||||
return playerLevelfix;
|
||||
}
|
||||
}
|
|
@ -46,6 +46,7 @@ public class SRobotSkill implements BaseConfig {
|
|||
|
||||
/**
|
||||
* 根据英雄id和下标id获取几技能
|
||||
* 主动技能+被动技能
|
||||
* @param heroTid
|
||||
* @param index
|
||||
* @return
|
||||
|
@ -64,4 +65,39 @@ public class SRobotSkill implements BaseConfig {
|
|||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 主动技能
|
||||
* @param heroTid
|
||||
* @return
|
||||
*/
|
||||
public static String getSkill(int heroTid){
|
||||
StringBuilder builder = new StringBuilder();
|
||||
SRobotSkill robotSkill = skillMap.get(heroTid);
|
||||
if (robotSkill == null){
|
||||
return "";
|
||||
}
|
||||
for (int i : robotSkill.getSkill()) {
|
||||
builder.append(i).append("#");
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 被动技能
|
||||
* @param heroTid
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
public static String getPassiveSkill(int heroTid, int index){
|
||||
StringBuilder builder = new StringBuilder();
|
||||
SRobotSkill robotSkill = skillMap.get(heroTid);
|
||||
if (robotSkill == null){
|
||||
return "";
|
||||
}
|
||||
for (int i : robotSkill.getPassiveSkill()[index]) {
|
||||
builder.append(i).append("#");
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue