mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-26 23:57:25 +01:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a1d8637f9 | ||
|
|
97119b7101 | ||
|
|
104029124b | ||
|
|
2aad37549c | ||
|
|
8dc05bd26a | ||
|
|
de0274a5be | ||
|
|
3d2dbb9f51 | ||
|
|
f53302cb18 | ||
|
|
8d6a40eb13 | ||
|
|
0199bcfb4c | ||
|
|
3fe895a668 | ||
|
|
025a63af28 | ||
|
|
528ac7a7e3 | ||
|
|
506afb95ed |
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?>
|
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?>
|
||||||
<jardesc>
|
<jardesc>
|
||||||
<jar path="ATCS/ATCS_v0.6.6.jar"/>
|
<jar path="ATCS/ATCS_v0.6.7.jar"/>
|
||||||
<options buildIfNeeded="true" compress="true" descriptionLocation="/ATCS/ATCS_JAR.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
|
<options buildIfNeeded="true" compress="true" descriptionLocation="/ATCS/ATCS_JAR.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
|
||||||
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
|
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
|
||||||
<selectedProjects/>
|
<selectedProjects/>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
v0.6.6
|
v0.6.7
|
||||||
@@ -4,7 +4,7 @@ set "ATCS_DIR=%~dp0"
|
|||||||
set "MAX_MEM=512M"
|
set "MAX_MEM=512M"
|
||||||
set "CP=%ATCS_DIR%lib\*"
|
set "CP=%ATCS_DIR%lib\*"
|
||||||
set "JAVA=javaw.exe"
|
set "JAVA=javaw.exe"
|
||||||
set "JAVA_OPTS="
|
set "JAVA_OPTS=-DFONT_SCALE=1.0 -Dswing.aatext=true"
|
||||||
set "ENV_FILE=%ATCS_DIR%ATCS.env.bat"
|
set "ENV_FILE=%ATCS_DIR%ATCS.env.bat"
|
||||||
set "MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio"
|
set "MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio"
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ ATCS_DIR=$(dirname $(readlink -f "$0" || greadlink -f "$0" || stat -f "$0"))
|
|||||||
MAX_MEM=512M
|
MAX_MEM=512M
|
||||||
CP=$(find ${ATCS_DIR}/lib/ -name '*.jar' | paste -sd: -)
|
CP=$(find ${ATCS_DIR}/lib/ -name '*.jar' | paste -sd: -)
|
||||||
JAVA=java
|
JAVA=java
|
||||||
JAVA_OPTS=
|
JAVA_OPTS='-DFONT_SCALE=1.0 -Dswing.aatext=true'
|
||||||
ENV_FILE=${ATCS_DIR}/ATCS.env
|
ENV_FILE=${ATCS_DIR}/ATCS.env
|
||||||
MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio
|
MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ set "ATCS_DIR=%~dp0"
|
|||||||
set "MAX_MEM=512M"
|
set "MAX_MEM=512M"
|
||||||
set "CP=%ATCS_DIR%lib\*"
|
set "CP=%ATCS_DIR%lib\*"
|
||||||
set "JAVA=javaw.exe"
|
set "JAVA=javaw.exe"
|
||||||
set "JAVA_OPTS="
|
set "JAVA_OPTS=-DFONT_SCALE=1.0 -Dswing.aatext=true"
|
||||||
set "ENV_FILE=%ATCS_DIR%ATCS.env.bat"
|
set "ENV_FILE=%ATCS_DIR%ATCS.env.bat"
|
||||||
set "MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio"
|
set "MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
!include MUI2.nsh
|
!include MUI2.nsh
|
||||||
|
|
||||||
!define VERSION "0.6.6"
|
!define VERSION "0.6.8"
|
||||||
!define TRAINER_VERSION "0.1.4"
|
!define TRAINER_VERSION "0.1.4"
|
||||||
!define JAVA_BIN "javaw"
|
!define JAVA_BIN "javaw"
|
||||||
|
|
||||||
|
|||||||
@@ -14,18 +14,23 @@ import java.io.InputStreamReader;
|
|||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import javax.swing.JEditorPane;
|
import javax.swing.JEditorPane;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.UIDefaults;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.UnsupportedLookAndFeelException;
|
import javax.swing.UnsupportedLookAndFeelException;
|
||||||
import javax.swing.event.HyperlinkEvent;
|
import javax.swing.event.HyperlinkEvent;
|
||||||
import javax.swing.event.HyperlinkListener;
|
import javax.swing.event.HyperlinkListener;
|
||||||
|
import javax.swing.plaf.FontUIResource;
|
||||||
|
|
||||||
import com.gpl.rpg.atcontentstudio.model.Workspace;
|
import com.gpl.rpg.atcontentstudio.model.Workspace;
|
||||||
import com.gpl.rpg.atcontentstudio.ui.StudioFrame;
|
import com.gpl.rpg.atcontentstudio.ui.StudioFrame;
|
||||||
@@ -38,12 +43,15 @@ import prefuse.data.expression.parser.ExpressionParser;
|
|||||||
public class ATContentStudio {
|
public class ATContentStudio {
|
||||||
|
|
||||||
public static final String APP_NAME = "Andor's Trail Content Studio";
|
public static final String APP_NAME = "Andor's Trail Content Studio";
|
||||||
public static final String APP_VERSION = "v0.6.6";
|
public static final String APP_VERSION = "v0.6.8";
|
||||||
|
|
||||||
public static final String CHECK_UPDATE_URL = "https://andorstrail.com/static/ATCS_latest";
|
public static final String CHECK_UPDATE_URL = "https://andorstrail.com/static/ATCS_latest";
|
||||||
public static final String DOWNLOAD_URL = "https://andorstrail.com/viewtopic.php?f=6&t=4806";
|
public static final String DOWNLOAD_URL = "https://andorstrail.com/viewtopic.php?f=6&t=4806";
|
||||||
|
|
||||||
|
public static final String FONT_SCALE_ENV_VAR_NAME = "FONT_SCALE";
|
||||||
|
|
||||||
public static boolean STARTED = false;
|
public static boolean STARTED = false;
|
||||||
|
public static float SCALING=1.0f;
|
||||||
public static StudioFrame frame = null;
|
public static StudioFrame frame = null;
|
||||||
|
|
||||||
//Need to keep a strong reference to it, to avoid garbage collection that'll reset these loggers.
|
//Need to keep a strong reference to it, to avoid garbage collection that'll reset these loggers.
|
||||||
@@ -53,6 +61,17 @@ public class ATContentStudio {
|
|||||||
* @param args
|
* @param args
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
String fontScaling = System.getProperty(FONT_SCALE_ENV_VAR_NAME);
|
||||||
|
Float fontScale = null;
|
||||||
|
if (fontScaling != null) {
|
||||||
|
try {
|
||||||
|
fontScale = Float.parseFloat(fontScaling);
|
||||||
|
SCALING=fontScale;
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
System.err.println("Failed to parse font scaling parameter. Using default.");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ConfigCache.init();
|
ConfigCache.init();
|
||||||
|
|
||||||
@@ -69,6 +88,9 @@ public class ATContentStudio {
|
|||||||
} catch (UnsupportedLookAndFeelException e) {
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
scaleUIFont();
|
||||||
|
|
||||||
//Need to keep a strong reference to it, to avoid garbage collection that'll reset this setting.
|
//Need to keep a strong reference to it, to avoid garbage collection that'll reset this setting.
|
||||||
Logger l = Logger.getLogger(ExpressionParser.class.getName());
|
Logger l = Logger.getLogger(ExpressionParser.class.getName());
|
||||||
@@ -178,4 +200,28 @@ public class ATContentStudio {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void scaleUIFont() {
|
||||||
|
if (SCALING != 1.0f) {
|
||||||
|
System.out.println("Scaling fonts to "+SCALING);
|
||||||
|
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
|
||||||
|
Map<Object, Object> newDefaults = new HashMap<Object, Object>();
|
||||||
|
for (Enumeration<Object> e = defaults.keys(); e.hasMoreElements();) {
|
||||||
|
Object key = e.nextElement();
|
||||||
|
Object value = defaults.get(key);
|
||||||
|
if (value instanceof Font) {
|
||||||
|
Font font = (Font) value;
|
||||||
|
int newSize = (int)(font.getSize() * SCALING);
|
||||||
|
if (value instanceof FontUIResource) {
|
||||||
|
newDefaults.put(key, new FontUIResource(font.getName(), font.getStyle(), newSize));
|
||||||
|
} else {
|
||||||
|
newDefaults.put(key, new Font(font.getName(), font.getStyle(), newSize));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Object key : newDefaults.keySet()) {
|
||||||
|
defaults.put(key, newDefaults.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
src/com/gpl/rpg/atcontentstudio/img/alignment.png
Normal file
BIN
src/com/gpl/rpg/atcontentstudio/img/alignment.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src/com/gpl/rpg/atcontentstudio/img/bonemeal.png
Normal file
BIN
src/com/gpl/rpg/atcontentstudio/img/bonemeal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 607 B |
BIN
src/com/gpl/rpg/atcontentstudio/img/timer.png
Normal file
BIN
src/com/gpl/rpg/atcontentstudio/img/timer.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 881 B |
BIN
src/com/gpl/rpg/atcontentstudio/img/ui_icon_immunity.png
Normal file
BIN
src/com/gpl/rpg/atcontentstudio/img/ui_icon_immunity.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/com/gpl/rpg/atcontentstudio/img/ui_icon_skill.png
Normal file
BIN
src/com/gpl/rpg/atcontentstudio/img/ui_icon_skill.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
@@ -222,6 +222,8 @@ public class Project implements ProjectTreeNode, Serializable {
|
|||||||
public void refreshTransients(Workspace w) {
|
public void refreshTransients(Workspace w) {
|
||||||
this.parent = w;
|
this.parent = w;
|
||||||
|
|
||||||
|
projectElementListeners = new HashMap<Class<? extends GameDataElement>, List<ProjectElementListener>>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
knownSpritesheetsProperties = new Properties();
|
knownSpritesheetsProperties = new Properties();
|
||||||
knownSpritesheetsProperties.load(Project.class.getResourceAsStream("/spritesheets.properties"));
|
knownSpritesheetsProperties.load(Project.class.getResourceAsStream("/spritesheets.properties"));
|
||||||
@@ -254,7 +256,6 @@ public class Project implements ProjectTreeNode, Serializable {
|
|||||||
|
|
||||||
linkAll();
|
linkAll();
|
||||||
|
|
||||||
projectElementListeners = new HashMap<Class<? extends GameDataElement>, List<ProjectElementListener>>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void linkAll() {
|
public void linkAll() {
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ public class ActorCondition extends JSONElement {
|
|||||||
|
|
||||||
private static final long serialVersionUID = -3969824899972048507L;
|
private static final long serialVersionUID = -3969824899972048507L;
|
||||||
|
|
||||||
public static final Integer CLEAR_AC_MAGNITUDE = -99;
|
public static final Integer MAGNITUDE_CLEAR = -99;
|
||||||
|
public static final Integer DURATION_FOREVER = 999;;
|
||||||
|
public static final Integer DURATION_NONE = 0;
|
||||||
|
|
||||||
// Available from init state
|
// Available from init state
|
||||||
//public String id; inherited.
|
//public String id; inherited.
|
||||||
@@ -43,9 +45,16 @@ public class ActorCondition extends JSONElement {
|
|||||||
blood
|
blood
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static enum VisualEffectID {
|
||||||
|
redSplash
|
||||||
|
,blueSwirl
|
||||||
|
,greenSplash
|
||||||
|
,miss
|
||||||
|
}
|
||||||
|
|
||||||
public static class RoundEffect implements Cloneable {
|
public static class RoundEffect implements Cloneable {
|
||||||
// Available from parsed state
|
// Available from parsed state
|
||||||
public String visual_effect = null;
|
public VisualEffectID visual_effect = null;
|
||||||
public Integer hp_boost_min = null;
|
public Integer hp_boost_min = null;
|
||||||
public Integer hp_boost_max = null;
|
public Integer hp_boost_max = null;
|
||||||
public Integer ap_boost_min = null;
|
public Integer ap_boost_min = null;
|
||||||
@@ -180,7 +189,13 @@ public class ActorCondition extends JSONElement {
|
|||||||
this.round_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)roundEffect.get("increaseCurrentAP")).get("max")));
|
this.round_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)roundEffect.get("increaseCurrentAP")).get("max")));
|
||||||
this.round_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)roundEffect.get("increaseCurrentAP")).get("min")));
|
this.round_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)roundEffect.get("increaseCurrentAP")).get("min")));
|
||||||
}
|
}
|
||||||
this.round_effect.visual_effect = (String) roundEffect.get("visualEffectID");
|
String vfx = (String) roundEffect.get("visualEffectID");
|
||||||
|
this.round_effect.visual_effect = null;
|
||||||
|
if (vfx != null) {
|
||||||
|
try {
|
||||||
|
this.round_effect.visual_effect = VisualEffectID.valueOf(vfx);
|
||||||
|
} catch(IllegalArgumentException e) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Map fullRoundEffect = (Map) aCondJson.get("fullRoundEffect");
|
Map fullRoundEffect = (Map) aCondJson.get("fullRoundEffect");
|
||||||
if (fullRoundEffect != null) {
|
if (fullRoundEffect != null) {
|
||||||
@@ -193,7 +208,13 @@ public class ActorCondition extends JSONElement {
|
|||||||
this.full_round_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)fullRoundEffect.get("increaseCurrentAP")).get("max")));
|
this.full_round_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)fullRoundEffect.get("increaseCurrentAP")).get("max")));
|
||||||
this.full_round_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)fullRoundEffect.get("increaseCurrentAP")).get("min")));
|
this.full_round_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)fullRoundEffect.get("increaseCurrentAP")).get("min")));
|
||||||
}
|
}
|
||||||
this.full_round_effect.visual_effect = (String) fullRoundEffect.get("visualEffectID");
|
String vfx = (String) roundEffect.get("visualEffectID");
|
||||||
|
this.full_round_effect.visual_effect = null;
|
||||||
|
if (vfx != null) {
|
||||||
|
try {
|
||||||
|
this.full_round_effect.visual_effect = VisualEffectID.valueOf(vfx);
|
||||||
|
} catch(IllegalArgumentException e) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.state = State.parsed;
|
this.state = State.parsed;
|
||||||
|
|
||||||
@@ -278,7 +299,7 @@ public class ActorCondition extends JSONElement {
|
|||||||
if (this.stacking != null && this.stacking == 1) jsonAC.put("isStacking", this.stacking);
|
if (this.stacking != null && this.stacking == 1) jsonAC.put("isStacking", this.stacking);
|
||||||
if (this.round_effect != null) {
|
if (this.round_effect != null) {
|
||||||
Map jsonRound = new LinkedHashMap();
|
Map jsonRound = new LinkedHashMap();
|
||||||
if (this.round_effect.visual_effect != null) jsonRound.put("visualEffectID", this.round_effect.visual_effect);
|
if (this.round_effect.visual_effect != null) jsonRound.put("visualEffectID", this.round_effect.visual_effect.toString());
|
||||||
if (this.round_effect.hp_boost_min != null || this.round_effect.hp_boost_max != null) {
|
if (this.round_effect.hp_boost_min != null || this.round_effect.hp_boost_max != null) {
|
||||||
Map jsonHP = new LinkedHashMap();
|
Map jsonHP = new LinkedHashMap();
|
||||||
if (this.round_effect.hp_boost_min != null) jsonHP.put("min", this.round_effect.hp_boost_min);
|
if (this.round_effect.hp_boost_min != null) jsonHP.put("min", this.round_effect.hp_boost_min);
|
||||||
@@ -299,7 +320,7 @@ public class ActorCondition extends JSONElement {
|
|||||||
}
|
}
|
||||||
if (this.full_round_effect != null) {
|
if (this.full_round_effect != null) {
|
||||||
Map jsonFullRound = new LinkedHashMap();
|
Map jsonFullRound = new LinkedHashMap();
|
||||||
if (this.full_round_effect.visual_effect != null) jsonFullRound.put("visualEffectID", this.full_round_effect.visual_effect);
|
if (this.full_round_effect.visual_effect != null) jsonFullRound.put("visualEffectID", this.full_round_effect.visual_effect.toString());
|
||||||
if (this.full_round_effect.hp_boost_min != null || this.full_round_effect.hp_boost_max != null) {
|
if (this.full_round_effect.hp_boost_min != null || this.full_round_effect.hp_boost_max != null) {
|
||||||
Map jsonHP = new LinkedHashMap();
|
Map jsonHP = new LinkedHashMap();
|
||||||
if (this.full_round_effect.hp_boost_min != null) jsonHP.put("min", this.full_round_effect.hp_boost_min);
|
if (this.full_round_effect.hp_boost_min != null) jsonHP.put("min", this.full_round_effect.hp_boost_min);
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public class Dialogue extends JSONElement {
|
|||||||
dropList,
|
dropList,
|
||||||
skillIncrease,
|
skillIncrease,
|
||||||
actorCondition,
|
actorCondition,
|
||||||
|
actorConditionImmunity,
|
||||||
alignmentChange,
|
alignmentChange,
|
||||||
giveItem,
|
giveItem,
|
||||||
createTimer,
|
createTimer,
|
||||||
@@ -250,6 +251,7 @@ public class Dialogue extends JSONElement {
|
|||||||
reward.map = reward.map_name != null ? proj.getMap(reward.map_name) : null;
|
reward.map = reward.map_name != null ? proj.getMap(reward.map_name) : null;
|
||||||
break;
|
break;
|
||||||
case actorCondition:
|
case actorCondition:
|
||||||
|
case actorConditionImmunity:
|
||||||
reward.reward_obj = proj.getActorCondition(reward.reward_obj_id);
|
reward.reward_obj = proj.getActorCondition(reward.reward_obj_id);
|
||||||
break;
|
break;
|
||||||
case alignmentChange:
|
case alignmentChange:
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ public class Item extends JSONElement {
|
|||||||
public String category_id = null;
|
public String category_id = null;
|
||||||
public String description = null;
|
public String description = null;
|
||||||
public HitEffect hit_effect = null;
|
public HitEffect hit_effect = null;
|
||||||
|
public HitReceivedEffect hit_received_effect = null;
|
||||||
public KillEffect kill_effect = null;
|
public KillEffect kill_effect = null;
|
||||||
public EquipEffect equip_effect = null;
|
public EquipEffect equip_effect = null;
|
||||||
|
|
||||||
@@ -58,6 +59,14 @@ public class Item extends JSONElement {
|
|||||||
public List<TimedConditionEffect> conditions_target = null;
|
public List<TimedConditionEffect> conditions_target = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class HitReceivedEffect extends HitEffect {
|
||||||
|
//Available from parsed state
|
||||||
|
public Integer hp_boost_min_target = null;
|
||||||
|
public Integer hp_boost_max_target = null;
|
||||||
|
public Integer ap_boost_min_target = null;
|
||||||
|
public Integer ap_boost_max_target = null;
|
||||||
|
}
|
||||||
|
|
||||||
public static class EquipEffect {
|
public static class EquipEffect {
|
||||||
//Available from parsed state
|
//Available from parsed state
|
||||||
public Integer damage_boost_min = null;
|
public Integer damage_boost_min = null;
|
||||||
@@ -246,6 +255,53 @@ public class Item extends JSONElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map hitReceivedEffect = (Map) itemJson.get("hitReceivedEffect");
|
||||||
|
if (hitReceivedEffect != null) {
|
||||||
|
this.hit_received_effect = new HitReceivedEffect();
|
||||||
|
if (hitReceivedEffect.get("increaseCurrentHP") != null) {
|
||||||
|
this.hit_received_effect.hp_boost_min = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentHP")).get("min")));
|
||||||
|
this.hit_received_effect.hp_boost_max = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentHP")).get("max")));
|
||||||
|
}
|
||||||
|
if (hitReceivedEffect.get("increaseCurrentAP") != null) {
|
||||||
|
this.hit_received_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentAP")).get("min")));
|
||||||
|
this.hit_received_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentAP")).get("max")));
|
||||||
|
}
|
||||||
|
if (hitReceivedEffect.get("increaseAttackerCurrentHP") != null) {
|
||||||
|
this.hit_received_effect.hp_boost_min_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentHP")).get("min")));
|
||||||
|
this.hit_received_effect.hp_boost_max_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentHP")).get("max")));
|
||||||
|
}
|
||||||
|
if (hitReceivedEffect.get("increaseAttackerCurrentAP") != null) {
|
||||||
|
this.hit_received_effect.ap_boost_min_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentAP")).get("min")));
|
||||||
|
this.hit_received_effect.ap_boost_max_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentAP")).get("max")));
|
||||||
|
}
|
||||||
|
List conditionsSourceJson = (List) hitReceivedEffect.get("conditionsSource");
|
||||||
|
if (conditionsSourceJson != null && !conditionsSourceJson.isEmpty()) {
|
||||||
|
this.hit_received_effect.conditions_source = new ArrayList<Item.TimedConditionEffect>();
|
||||||
|
for (Object conditionJsonObj : conditionsSourceJson) {
|
||||||
|
Map conditionJson = (Map)conditionJsonObj;
|
||||||
|
TimedConditionEffect condition = new TimedConditionEffect();
|
||||||
|
condition.condition_id = (String) conditionJson.get("condition");
|
||||||
|
condition.magnitude = JSONElement.getInteger((Number) conditionJson.get("magnitude"));
|
||||||
|
condition.duration = JSONElement.getInteger((Number) conditionJson.get("duration"));
|
||||||
|
if (conditionJson.get("chance") != null) condition.chance = JSONElement.parseChance(conditionJson.get("chance").toString());
|
||||||
|
this.hit_received_effect.conditions_source.add(condition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List conditionsTargetJson = (List) hitReceivedEffect.get("conditionsTarget");
|
||||||
|
if (conditionsTargetJson != null && !conditionsTargetJson.isEmpty()) {
|
||||||
|
this.hit_received_effect.conditions_target = new ArrayList<Item.TimedConditionEffect>();
|
||||||
|
for (Object conditionJsonObj : conditionsTargetJson) {
|
||||||
|
Map conditionJson = (Map)conditionJsonObj;
|
||||||
|
TimedConditionEffect condition = new TimedConditionEffect();
|
||||||
|
condition.condition_id = (String) conditionJson.get("condition");
|
||||||
|
condition.magnitude = JSONElement.getInteger((Number) conditionJson.get("magnitude"));
|
||||||
|
condition.duration = JSONElement.getInteger((Number) conditionJson.get("duration"));
|
||||||
|
if (conditionJson.get("chance") != null) condition.chance = JSONElement.parseChance(conditionJson.get("chance").toString());
|
||||||
|
this.hit_received_effect.conditions_target.add(condition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Map killEffect = (Map) itemJson.get("killEffect");
|
Map killEffect = (Map) itemJson.get("killEffect");
|
||||||
if (killEffect == null) {
|
if (killEffect == null) {
|
||||||
killEffect = (Map) itemJson.get("useEffect");
|
killEffect = (Map) itemJson.get("useEffect");
|
||||||
@@ -321,6 +377,18 @@ public class Item extends JSONElement {
|
|||||||
if (ce.condition != null) ce.condition.addBacklink(this);
|
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.hit_received_effect != null && this.hit_received_effect.conditions_source != null) {
|
||||||
|
for (TimedConditionEffect ce : this.hit_received_effect.conditions_source) {
|
||||||
|
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||||
|
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect != null && this.hit_received_effect.conditions_target != null) {
|
||||||
|
for (TimedConditionEffect ce : this.hit_received_effect.conditions_target) {
|
||||||
|
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||||
|
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (this.kill_effect != null && this.kill_effect.conditions_source != null) {
|
if (this.kill_effect != null && this.kill_effect.conditions_source != null) {
|
||||||
for (TimedConditionEffect ce : this.kill_effect.conditions_source) {
|
for (TimedConditionEffect ce : this.kill_effect.conditions_source) {
|
||||||
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||||
@@ -422,6 +490,47 @@ public class Item extends JSONElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.hit_received_effect != null) {
|
||||||
|
clone.hit_received_effect = new HitReceivedEffect();
|
||||||
|
clone.hit_received_effect.ap_boost_max = this.hit_received_effect.ap_boost_max;
|
||||||
|
clone.hit_received_effect.ap_boost_min = this.hit_received_effect.ap_boost_min;
|
||||||
|
clone.hit_received_effect.hp_boost_max = this.hit_received_effect.hp_boost_max;
|
||||||
|
clone.hit_received_effect.hp_boost_min = this.hit_received_effect.hp_boost_min;
|
||||||
|
clone.hit_received_effect.ap_boost_max_target = this.hit_received_effect.ap_boost_max_target;
|
||||||
|
clone.hit_received_effect.ap_boost_min_target = this.hit_received_effect.ap_boost_min_target;
|
||||||
|
clone.hit_received_effect.hp_boost_max_target = this.hit_received_effect.hp_boost_max_target;
|
||||||
|
clone.hit_received_effect.hp_boost_min_target = this.hit_received_effect.hp_boost_min_target;
|
||||||
|
if (this.hit_received_effect.conditions_source != null) {
|
||||||
|
clone.hit_received_effect.conditions_source = new ArrayList<Item.TimedConditionEffect>();
|
||||||
|
for (TimedConditionEffect c : this.hit_received_effect.conditions_source) {
|
||||||
|
TimedConditionEffect cclone = new TimedConditionEffect();
|
||||||
|
cclone.magnitude = c.magnitude;
|
||||||
|
cclone.condition_id = c.condition_id;
|
||||||
|
cclone.condition = c.condition;
|
||||||
|
cclone.chance = c.chance;
|
||||||
|
cclone.duration = c.duration;
|
||||||
|
if (cclone.condition != null) {
|
||||||
|
cclone.condition.addBacklink(clone);
|
||||||
|
}
|
||||||
|
clone.hit_received_effect.conditions_source.add(cclone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect.conditions_target != null) {
|
||||||
|
clone.hit_received_effect.conditions_target = new ArrayList<Item.TimedConditionEffect>();
|
||||||
|
for (TimedConditionEffect c : this.hit_received_effect.conditions_target) {
|
||||||
|
TimedConditionEffect cclone = new TimedConditionEffect();
|
||||||
|
cclone.magnitude = c.magnitude;
|
||||||
|
cclone.condition_id = c.condition_id;
|
||||||
|
cclone.condition = c.condition;
|
||||||
|
cclone.chance = c.chance;
|
||||||
|
cclone.duration = c.duration;
|
||||||
|
if (cclone.condition != null) {
|
||||||
|
cclone.condition.addBacklink(clone);
|
||||||
|
}
|
||||||
|
clone.hit_received_effect.conditions_target.add(cclone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (this.kill_effect != null) {
|
if (this.kill_effect != null) {
|
||||||
clone.kill_effect = new KillEffect();
|
clone.kill_effect = new KillEffect();
|
||||||
clone.kill_effect.ap_boost_max = this.kill_effect.ap_boost_max;
|
clone.kill_effect.ap_boost_max = this.kill_effect.ap_boost_max;
|
||||||
@@ -600,6 +709,74 @@ public class Item extends JSONElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.hit_received_effect != null) {
|
||||||
|
Map hitReceivedEffectJson = new LinkedHashMap();
|
||||||
|
itemJson.put("hitReceivedEffect", hitReceivedEffectJson);
|
||||||
|
if (this.hit_received_effect.hp_boost_min != null || this.hit_received_effect.hp_boost_max != null) {
|
||||||
|
Map hpJson = new LinkedHashMap();
|
||||||
|
hitReceivedEffectJson.put("increaseCurrentHP", hpJson);
|
||||||
|
if (this.hit_received_effect.hp_boost_min != null) hpJson.put("min", this.hit_received_effect.hp_boost_min);
|
||||||
|
else hpJson.put("min", 0);
|
||||||
|
if (this.hit_received_effect.hp_boost_max != null) hpJson.put("max", this.hit_received_effect.hp_boost_max);
|
||||||
|
else hpJson.put("max", 0);
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect.ap_boost_min != null || this.hit_received_effect.ap_boost_max != null) {
|
||||||
|
Map apJson = new LinkedHashMap();
|
||||||
|
hitReceivedEffectJson.put("increaseCurrentAP", apJson);
|
||||||
|
if (this.hit_received_effect.ap_boost_min != null) apJson.put("min", this.hit_received_effect.ap_boost_min);
|
||||||
|
else apJson.put("min", 0);
|
||||||
|
if (this.hit_received_effect.ap_boost_max != null) apJson.put("max", this.hit_received_effect.ap_boost_max);
|
||||||
|
else apJson.put("max", 0);
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect.hp_boost_min_target != null || this.hit_received_effect.hp_boost_max_target != null) {
|
||||||
|
Map hpJson = new LinkedHashMap();
|
||||||
|
hitReceivedEffectJson.put("increaseAttackerCurrentHP", hpJson);
|
||||||
|
if (this.hit_received_effect.hp_boost_min_target != null) hpJson.put("min", this.hit_received_effect.hp_boost_min_target);
|
||||||
|
else hpJson.put("min", 0);
|
||||||
|
if (this.hit_received_effect.hp_boost_max_target != null) hpJson.put("max", this.hit_received_effect.hp_boost_max_target);
|
||||||
|
else hpJson.put("max", 0);
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect.ap_boost_min_target != null || this.hit_received_effect.ap_boost_max_target != null) {
|
||||||
|
Map apJson = new LinkedHashMap();
|
||||||
|
hitReceivedEffectJson.put("increaseAttackerCurrentAP", apJson);
|
||||||
|
if (this.hit_received_effect.ap_boost_min_target != null) apJson.put("min", this.hit_received_effect.ap_boost_min_target);
|
||||||
|
else apJson.put("min", 0);
|
||||||
|
if (this.hit_received_effect.ap_boost_max_target != null) apJson.put("max", this.hit_received_effect.ap_boost_max_target);
|
||||||
|
else apJson.put("max", 0);
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect.conditions_source != null) {
|
||||||
|
List conditionsSourceJson = new ArrayList();
|
||||||
|
hitReceivedEffectJson.put("conditionsSource", conditionsSourceJson);
|
||||||
|
for (TimedConditionEffect condition : this.hit_received_effect.conditions_source) {
|
||||||
|
Map conditionJson = new LinkedHashMap();
|
||||||
|
conditionsSourceJson.add(conditionJson);
|
||||||
|
if (condition.condition != null) {
|
||||||
|
conditionJson.put("condition", condition.condition.id);
|
||||||
|
} else if (condition.condition_id != null) {
|
||||||
|
conditionJson.put("condition", condition.condition_id);
|
||||||
|
}
|
||||||
|
if (condition.magnitude != null) conditionJson.put("magnitude", condition.magnitude);
|
||||||
|
if (condition.duration != null) conditionJson.put("duration", condition.duration);
|
||||||
|
if (condition.chance != null) conditionJson.put("chance", JSONElement.printJsonChance(condition.chance));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect.conditions_target != null) {
|
||||||
|
List conditionsTargetJson = new ArrayList();
|
||||||
|
hitReceivedEffectJson.put("conditionsTarget", conditionsTargetJson);
|
||||||
|
for (TimedConditionEffect condition : this.hit_received_effect.conditions_target) {
|
||||||
|
Map conditionJson = new LinkedHashMap();
|
||||||
|
conditionsTargetJson.add(conditionJson);
|
||||||
|
if (condition.condition != null) {
|
||||||
|
conditionJson.put("condition", condition.condition.id);
|
||||||
|
} else if (condition.condition_id != null) {
|
||||||
|
conditionJson.put("condition", condition.condition_id);
|
||||||
|
}
|
||||||
|
if (condition.magnitude != null) conditionJson.put("magnitude", condition.magnitude);
|
||||||
|
if (condition.duration != null) conditionJson.put("duration", condition.duration);
|
||||||
|
if (condition.chance != null) conditionJson.put("chance", JSONElement.printJsonChance(condition.chance));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (this.kill_effect != null) {
|
if (this.kill_effect != null) {
|
||||||
Map killEffectJson = new LinkedHashMap();
|
Map killEffectJson = new LinkedHashMap();
|
||||||
if (this.category != null && this.category.action_type != null && this.category.action_type == ItemCategory.ActionType.equip) {
|
if (this.category != null && this.category.action_type != null && this.category.action_type == ItemCategory.ActionType.equip) {
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ public class NPC extends JSONElement {
|
|||||||
public Integer block_chance = null;
|
public Integer block_chance = null;
|
||||||
public Integer damage_resistance = null;
|
public Integer damage_resistance = null;
|
||||||
public HitEffect hit_effect = null;
|
public HitEffect hit_effect = null;
|
||||||
|
public HitReceivedEffect hit_received_effect = null;
|
||||||
|
public DeathEffect death_effect = null;
|
||||||
|
|
||||||
//Available from linked state
|
//Available from linked state
|
||||||
public Dialogue dialogue = null;
|
public Dialogue dialogue = null;
|
||||||
@@ -70,17 +72,29 @@ public class NPC extends JSONElement {
|
|||||||
protectSpawn,
|
protectSpawn,
|
||||||
wholeMap
|
wholeMap
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class HitEffect {
|
public static class DeathEffect {
|
||||||
//Available from parsed state
|
//Available from parsed state
|
||||||
public Integer hp_boost_min = null;
|
public Integer hp_boost_min = null;
|
||||||
public Integer hp_boost_max = null;
|
public Integer hp_boost_max = null;
|
||||||
public Integer ap_boost_min = null;
|
public Integer ap_boost_min = null;
|
||||||
public Integer ap_boost_max = null;
|
public Integer ap_boost_max = null;
|
||||||
public List<TimedConditionEffect> conditions_source = null;
|
public List<TimedConditionEffect> conditions_source = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class HitEffect extends DeathEffect {
|
||||||
|
//Available from parsed state
|
||||||
public List<TimedConditionEffect> conditions_target = null;
|
public List<TimedConditionEffect> conditions_target = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class HitReceivedEffect extends HitEffect {
|
||||||
|
//Available from parsed state
|
||||||
|
public Integer hp_boost_min_target = null;
|
||||||
|
public Integer hp_boost_max_target = null;
|
||||||
|
public Integer ap_boost_min_target = null;
|
||||||
|
public Integer ap_boost_max_target = null;
|
||||||
|
}
|
||||||
|
|
||||||
public static class TimedConditionEffect {
|
public static class TimedConditionEffect {
|
||||||
//Available from parsed state
|
//Available from parsed state
|
||||||
public Integer magnitude = null;
|
public Integer magnitude = null;
|
||||||
@@ -224,6 +238,79 @@ public class NPC extends JSONElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map hitReceivedEffect = (Map) npcJson.get("hitReceivedEffect");
|
||||||
|
if (hitReceivedEffect != null) {
|
||||||
|
this.hit_received_effect = new HitReceivedEffect();
|
||||||
|
if (hitReceivedEffect.get("increaseCurrentHP") != null) {
|
||||||
|
this.hit_received_effect.hp_boost_max = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentHP")).get("max")));
|
||||||
|
this.hit_received_effect.hp_boost_min = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentHP")).get("min")));
|
||||||
|
}
|
||||||
|
if (hitReceivedEffect.get("increaseCurrentAP") != null) {
|
||||||
|
this.hit_received_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentAP")).get("max")));
|
||||||
|
this.hit_received_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentAP")).get("min")));
|
||||||
|
}
|
||||||
|
if (hitReceivedEffect.get("increaseAttackerCurrentHP") != null) {
|
||||||
|
this.hit_received_effect.hp_boost_max_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentHP")).get("max")));
|
||||||
|
this.hit_received_effect.hp_boost_min_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentHP")).get("min")));
|
||||||
|
}
|
||||||
|
if (hitReceivedEffect.get("increaseAttackerCurrentAP") != null) {
|
||||||
|
this.hit_received_effect.ap_boost_max_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentAP")).get("max")));
|
||||||
|
this.hit_received_effect.ap_boost_min_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentAP")).get("min")));
|
||||||
|
}
|
||||||
|
List conditionsSourceJson = (List) hitReceivedEffect.get("conditionsSource");
|
||||||
|
if (conditionsSourceJson != null && !conditionsSourceJson.isEmpty()) {
|
||||||
|
this.hit_received_effect.conditions_source = new ArrayList<NPC.TimedConditionEffect>();
|
||||||
|
for (Object conditionJsonObj : conditionsSourceJson) {
|
||||||
|
Map conditionJson = (Map)conditionJsonObj;
|
||||||
|
TimedConditionEffect condition = new TimedConditionEffect();
|
||||||
|
condition.condition_id = (String) conditionJson.get("condition");
|
||||||
|
condition.magnitude = JSONElement.getInteger((Number) conditionJson.get("magnitude"));
|
||||||
|
condition.duration = JSONElement.getInteger((Number) conditionJson.get("duration"));
|
||||||
|
if (conditionJson.get("chance") != null) condition.chance = JSONElement.parseChance(conditionJson.get("chance").toString());
|
||||||
|
this.hit_received_effect.conditions_source.add(condition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List conditionsTargetJson = (List) hitReceivedEffect.get("conditionsTarget");
|
||||||
|
if (conditionsTargetJson != null && !conditionsTargetJson.isEmpty()) {
|
||||||
|
this.hit_received_effect.conditions_target = new ArrayList<NPC.TimedConditionEffect>();
|
||||||
|
for (Object conditionJsonObj : conditionsTargetJson) {
|
||||||
|
Map conditionJson = (Map)conditionJsonObj;
|
||||||
|
TimedConditionEffect condition = new TimedConditionEffect();
|
||||||
|
condition.condition_id = (String) conditionJson.get("condition");
|
||||||
|
condition.magnitude = JSONElement.getInteger((Number) conditionJson.get("magnitude"));
|
||||||
|
condition.duration = JSONElement.getInteger((Number) conditionJson.get("duration"));
|
||||||
|
if (conditionJson.get("chance") != null) condition.chance = JSONElement.parseChance(conditionJson.get("chance").toString());
|
||||||
|
this.hit_received_effect.conditions_target.add(condition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map deathEffect = (Map) npcJson.get("deathEffect");
|
||||||
|
if (deathEffect != null) {
|
||||||
|
this.death_effect = new HitEffect();
|
||||||
|
if (deathEffect.get("increaseCurrentHP") != null) {
|
||||||
|
this.death_effect.hp_boost_max = JSONElement.getInteger((Number) (((Map)deathEffect.get("increaseCurrentHP")).get("max")));
|
||||||
|
this.death_effect.hp_boost_min = JSONElement.getInteger((Number) (((Map)deathEffect.get("increaseCurrentHP")).get("min")));
|
||||||
|
}
|
||||||
|
if (deathEffect.get("increaseCurrentAP") != null) {
|
||||||
|
this.death_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)deathEffect.get("increaseCurrentAP")).get("max")));
|
||||||
|
this.death_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)deathEffect.get("increaseCurrentAP")).get("min")));
|
||||||
|
}
|
||||||
|
List conditionsSourceJson = (List) deathEffect.get("conditionsSource");
|
||||||
|
if (conditionsSourceJson != null && !conditionsSourceJson.isEmpty()) {
|
||||||
|
this.death_effect.conditions_source = new ArrayList<NPC.TimedConditionEffect>();
|
||||||
|
for (Object conditionJsonObj : conditionsSourceJson) {
|
||||||
|
Map conditionJson = (Map)conditionJsonObj;
|
||||||
|
TimedConditionEffect condition = new TimedConditionEffect();
|
||||||
|
condition.condition_id = (String) conditionJson.get("condition");
|
||||||
|
condition.magnitude = JSONElement.getInteger((Number) conditionJson.get("magnitude"));
|
||||||
|
condition.duration = JSONElement.getInteger((Number) conditionJson.get("duration"));
|
||||||
|
if (conditionJson.get("chance") != null) condition.chance = JSONElement.parseChance(conditionJson.get("chance").toString());
|
||||||
|
this.death_effect.conditions_source.add(condition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -267,6 +354,24 @@ public class NPC extends JSONElement {
|
|||||||
if (ce.condition != null) ce.condition.addBacklink(this);
|
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.hit_received_effect != null && this.hit_received_effect.conditions_source != null) {
|
||||||
|
for (TimedConditionEffect ce : this.hit_received_effect.conditions_source) {
|
||||||
|
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||||
|
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect != null && this.hit_received_effect.conditions_target != null) {
|
||||||
|
for (TimedConditionEffect ce : this.hit_received_effect.conditions_target) {
|
||||||
|
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||||
|
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.death_effect != null && this.death_effect.conditions_source != null) {
|
||||||
|
for (TimedConditionEffect ce : this.death_effect.conditions_source) {
|
||||||
|
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||||
|
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
this.state = State.linked;
|
this.state = State.linked;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,6 +448,69 @@ public class NPC extends JSONElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.hit_received_effect != null) {
|
||||||
|
clone.hit_received_effect = new HitReceivedEffect();
|
||||||
|
clone.hit_received_effect.ap_boost_max = this.hit_received_effect.ap_boost_max;
|
||||||
|
clone.hit_received_effect.ap_boost_min = this.hit_received_effect.ap_boost_min;
|
||||||
|
clone.hit_received_effect.hp_boost_max = this.hit_received_effect.hp_boost_max;
|
||||||
|
clone.hit_received_effect.hp_boost_min = this.hit_received_effect.hp_boost_min;
|
||||||
|
clone.hit_received_effect.ap_boost_max_target = this.hit_received_effect.ap_boost_max_target;
|
||||||
|
clone.hit_received_effect.ap_boost_min_target = this.hit_received_effect.ap_boost_min_target;
|
||||||
|
clone.hit_received_effect.hp_boost_max_target = this.hit_received_effect.hp_boost_max_target;
|
||||||
|
clone.hit_received_effect.hp_boost_min_target = this.hit_received_effect.hp_boost_min_target;
|
||||||
|
if (this.hit_received_effect.conditions_source != null) {
|
||||||
|
clone.hit_received_effect.conditions_source = new ArrayList<TimedConditionEffect>();
|
||||||
|
for (TimedConditionEffect c : this.hit_received_effect.conditions_source) {
|
||||||
|
TimedConditionEffect cclone = new TimedConditionEffect();
|
||||||
|
cclone.magnitude = c.magnitude;
|
||||||
|
cclone.condition_id = c.condition_id;
|
||||||
|
cclone.condition = c.condition;
|
||||||
|
cclone.chance = c.chance;
|
||||||
|
cclone.duration = c.duration;
|
||||||
|
if (cclone.condition != null) {
|
||||||
|
cclone.condition.addBacklink(clone);
|
||||||
|
}
|
||||||
|
clone.hit_received_effect.conditions_source.add(cclone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect.conditions_target != null) {
|
||||||
|
clone.hit_received_effect.conditions_target = new ArrayList<TimedConditionEffect>();
|
||||||
|
for (TimedConditionEffect c : this.hit_received_effect.conditions_target) {
|
||||||
|
TimedConditionEffect cclone = new TimedConditionEffect();
|
||||||
|
cclone.magnitude = c.magnitude;
|
||||||
|
cclone.condition_id = c.condition_id;
|
||||||
|
cclone.condition = c.condition;
|
||||||
|
cclone.chance = c.chance;
|
||||||
|
cclone.duration = c.duration;
|
||||||
|
if (cclone.condition != null) {
|
||||||
|
cclone.condition.addBacklink(clone);
|
||||||
|
}
|
||||||
|
clone.hit_received_effect.conditions_target.add(cclone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.death_effect != null) {
|
||||||
|
clone.death_effect = new DeathEffect();
|
||||||
|
clone.death_effect.ap_boost_max = this.death_effect.ap_boost_max;
|
||||||
|
clone.death_effect.ap_boost_min = this.death_effect.ap_boost_min;
|
||||||
|
clone.death_effect.hp_boost_max = this.death_effect.hp_boost_max;
|
||||||
|
clone.death_effect.hp_boost_min = this.death_effect.hp_boost_min;
|
||||||
|
if (this.death_effect.conditions_source != null) {
|
||||||
|
clone.death_effect.conditions_source = new ArrayList<TimedConditionEffect>();
|
||||||
|
for (TimedConditionEffect c : this.death_effect.conditions_source) {
|
||||||
|
TimedConditionEffect cclone = new TimedConditionEffect();
|
||||||
|
cclone.magnitude = c.magnitude;
|
||||||
|
cclone.condition_id = c.condition_id;
|
||||||
|
cclone.condition = c.condition;
|
||||||
|
cclone.chance = c.chance;
|
||||||
|
cclone.duration = c.duration;
|
||||||
|
if (cclone.condition != null) {
|
||||||
|
cclone.condition.addBacklink(clone);
|
||||||
|
}
|
||||||
|
clone.death_effect.conditions_source.add(cclone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
clone.max_ap = this.max_ap;
|
clone.max_ap = this.max_ap;
|
||||||
clone.max_hp = this.max_hp;
|
clone.max_hp = this.max_hp;
|
||||||
clone.monster_class = this.monster_class;
|
clone.monster_class = this.monster_class;
|
||||||
@@ -478,6 +646,110 @@ public class NPC extends JSONElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.hit_received_effect != null) {
|
||||||
|
Map hitReceivedEffectJson = new LinkedHashMap();
|
||||||
|
npcJson.put("hitReceivedEffect", hitReceivedEffectJson);
|
||||||
|
if (this.hit_received_effect.hp_boost_min != null || this.hit_received_effect.hp_boost_max != null) {
|
||||||
|
Map hpJson = new LinkedHashMap();
|
||||||
|
hitReceivedEffectJson.put("increaseCurrentHP", hpJson);
|
||||||
|
if (this.hit_received_effect.hp_boost_min != null) hpJson.put("min", this.hit_received_effect.hp_boost_min);
|
||||||
|
else hpJson.put("min", 0);
|
||||||
|
if (this.hit_received_effect.hp_boost_max != null) hpJson.put("max", this.hit_received_effect.hp_boost_max);
|
||||||
|
else hpJson.put("max", 0);
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect.ap_boost_min != null || this.hit_received_effect.ap_boost_max != null) {
|
||||||
|
Map apJson = new LinkedHashMap();
|
||||||
|
hitReceivedEffectJson.put("increaseCurrentAP", apJson);
|
||||||
|
if (this.hit_received_effect.ap_boost_min != null) apJson.put("min", this.hit_received_effect.ap_boost_min);
|
||||||
|
else apJson.put("min", 0);
|
||||||
|
if (this.hit_received_effect.ap_boost_max != null) apJson.put("max", this.hit_received_effect.ap_boost_max);
|
||||||
|
else apJson.put("max", 0);
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect.hp_boost_min_target != null || this.hit_received_effect.hp_boost_max_target != null) {
|
||||||
|
Map hpJson = new LinkedHashMap();
|
||||||
|
hitReceivedEffectJson.put("increaseAttackerCurrentHP", hpJson);
|
||||||
|
if (this.hit_received_effect.hp_boost_min_target != null) hpJson.put("min", this.hit_received_effect.hp_boost_min_target);
|
||||||
|
else hpJson.put("min", 0);
|
||||||
|
if (this.hit_received_effect.hp_boost_max_target != null) hpJson.put("max", this.hit_received_effect.hp_boost_max_target);
|
||||||
|
else hpJson.put("max", 0);
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect.ap_boost_min_target != null || this.hit_received_effect.ap_boost_max_target != null) {
|
||||||
|
Map apJson = new LinkedHashMap();
|
||||||
|
hitReceivedEffectJson.put("increaseAttackerCurrentAP", apJson);
|
||||||
|
if (this.hit_received_effect.ap_boost_min_target != null) apJson.put("min", this.hit_received_effect.ap_boost_min_target);
|
||||||
|
else apJson.put("min", 0);
|
||||||
|
if (this.hit_received_effect.ap_boost_max_target != null) apJson.put("max", this.hit_received_effect.ap_boost_max_target);
|
||||||
|
else apJson.put("max", 0);
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect.conditions_source != null) {
|
||||||
|
List conditionsSourceJson = new ArrayList();
|
||||||
|
hitReceivedEffectJson.put("conditionsSource", conditionsSourceJson);
|
||||||
|
for (TimedConditionEffect condition : this.hit_received_effect.conditions_source) {
|
||||||
|
Map conditionJson = new LinkedHashMap();
|
||||||
|
conditionsSourceJson.add(conditionJson);
|
||||||
|
if (condition.condition != null) {
|
||||||
|
conditionJson.put("condition", condition.condition.id);
|
||||||
|
} else if (condition.condition_id != null) {
|
||||||
|
conditionJson.put("condition", condition.condition_id);
|
||||||
|
}
|
||||||
|
if (condition.magnitude != null) conditionJson.put("magnitude", condition.magnitude);
|
||||||
|
if (condition.duration != null) conditionJson.put("duration", condition.duration);
|
||||||
|
if (condition.chance != null) conditionJson.put("chance", JSONElement.printJsonChance(condition.chance));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.hit_received_effect.conditions_target != null) {
|
||||||
|
List conditionsTargetJson = new ArrayList();
|
||||||
|
hitReceivedEffectJson.put("conditionsTarget", conditionsTargetJson);
|
||||||
|
for (TimedConditionEffect condition : this.hit_received_effect.conditions_target) {
|
||||||
|
Map conditionJson = new LinkedHashMap();
|
||||||
|
conditionsTargetJson.add(conditionJson);
|
||||||
|
if (condition.condition != null) {
|
||||||
|
conditionJson.put("condition", condition.condition.id);
|
||||||
|
} else if (condition.condition_id != null) {
|
||||||
|
conditionJson.put("condition", condition.condition_id);
|
||||||
|
}
|
||||||
|
if (condition.magnitude != null) conditionJson.put("magnitude", condition.magnitude);
|
||||||
|
if (condition.duration != null) conditionJson.put("duration", condition.duration);
|
||||||
|
if (condition.chance != null) conditionJson.put("chance", JSONElement.printJsonChance(condition.chance));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.death_effect != null) {
|
||||||
|
Map deathEffectJson = new LinkedHashMap();
|
||||||
|
npcJson.put("deathEffect", deathEffectJson);
|
||||||
|
if (this.death_effect.hp_boost_min != null || this.death_effect.hp_boost_max != null) {
|
||||||
|
Map hpJson = new LinkedHashMap();
|
||||||
|
deathEffectJson.put("increaseCurrentHP", hpJson);
|
||||||
|
if (this.death_effect.hp_boost_min != null) hpJson.put("min", this.death_effect.hp_boost_min);
|
||||||
|
else hpJson.put("min", 0);
|
||||||
|
if (this.death_effect.hp_boost_max != null) hpJson.put("max", this.death_effect.hp_boost_max);
|
||||||
|
else hpJson.put("max", 0);
|
||||||
|
}
|
||||||
|
if (this.death_effect.ap_boost_min != null || this.death_effect.ap_boost_max != null) {
|
||||||
|
Map apJson = new LinkedHashMap();
|
||||||
|
deathEffectJson.put("increaseCurrentAP", apJson);
|
||||||
|
if (this.death_effect.ap_boost_min != null) apJson.put("min", this.death_effect.ap_boost_min);
|
||||||
|
else apJson.put("min", 0);
|
||||||
|
if (this.death_effect.ap_boost_max != null) apJson.put("max", this.death_effect.ap_boost_max);
|
||||||
|
else apJson.put("max", 0);
|
||||||
|
}
|
||||||
|
if (this.death_effect.conditions_source != null) {
|
||||||
|
List conditionsSourceJson = new ArrayList();
|
||||||
|
deathEffectJson.put("conditionsSource", conditionsSourceJson);
|
||||||
|
for (TimedConditionEffect condition : this.death_effect.conditions_source) {
|
||||||
|
Map conditionJson = new LinkedHashMap();
|
||||||
|
conditionsSourceJson.add(conditionJson);
|
||||||
|
if (condition.condition != null) {
|
||||||
|
conditionJson.put("condition", condition.condition.id);
|
||||||
|
} else if (condition.condition_id != null) {
|
||||||
|
conditionJson.put("condition", condition.condition_id);
|
||||||
|
}
|
||||||
|
if (condition.magnitude != null) conditionJson.put("magnitude", condition.magnitude);
|
||||||
|
if (condition.duration != null) conditionJson.put("duration", condition.duration);
|
||||||
|
if (condition.chance != null) conditionJson.put("chance", JSONElement.printJsonChance(condition.chance));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return npcJson;
|
return npcJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,12 +53,61 @@ public class Requirement extends JSONElement {
|
|||||||
usedItem,
|
usedItem,
|
||||||
spentGold,
|
spentGold,
|
||||||
consumedBonemeals,
|
consumedBonemeals,
|
||||||
hasActorCondition
|
hasActorCondition,
|
||||||
|
factionScore
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SkillID {
|
||||||
|
weaponChance
|
||||||
|
,weaponDmg
|
||||||
|
,barter
|
||||||
|
,dodge
|
||||||
|
,barkSkin
|
||||||
|
,moreCriticals
|
||||||
|
,betterCriticals
|
||||||
|
,speed // Raises max ap
|
||||||
|
,coinfinder
|
||||||
|
,moreExp
|
||||||
|
,cleave // +10ap on kill
|
||||||
|
,eater // +1hp per kill
|
||||||
|
,fortitude // +N hp per levelup
|
||||||
|
,evasion // increase successful flee chance & reduce chance of monster attack
|
||||||
|
,regeneration // +N hp per round
|
||||||
|
,lowerExploss
|
||||||
|
,magicfinder
|
||||||
|
,resistanceMental // lowers chance to get negative active conditions by monsters (Mental like Dazed)
|
||||||
|
,resistancePhysical // lowers chance to get negative active conditions by monsters (Physical Capacity like Minor fatigue)
|
||||||
|
,resistanceBlood // lowers chance to get negative active conditions by monsters (Blood Disorder like Weak Poison)
|
||||||
|
,shadowBless
|
||||||
|
,crit1 // lowers atk ability
|
||||||
|
,crit2 // lowers def ability ,rejuvenation // Reduces magnitudes of conditions
|
||||||
|
,rejuvenation // Reduces magnitudes of conditions
|
||||||
|
,taunt // Causes AP loss of attackers that miss
|
||||||
|
,concussion // AC loss for monsters with (AC-BC)>N
|
||||||
|
,weaponProficiencyDagger
|
||||||
|
,weaponProficiency1hsword
|
||||||
|
,weaponProficiency2hsword
|
||||||
|
,weaponProficiencyAxe
|
||||||
|
,weaponProficiencyBlunt
|
||||||
|
,weaponProficiencyUnarmed
|
||||||
|
,armorProficiencyShield
|
||||||
|
,armorProficiencyUnarmored
|
||||||
|
,armorProficiencyLight
|
||||||
|
,armorProficiencyHeavy
|
||||||
|
,fightstyleDualWield
|
||||||
|
,fightstyle2hand
|
||||||
|
,fightstyleWeaponShield
|
||||||
|
,specializationDualWield
|
||||||
|
,specialization2hand
|
||||||
|
,specializationWeaponShield
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDesc() {
|
public String getDesc() {
|
||||||
return ((negated != null && negated) ? "NOT " : "")+required_obj_id+(required_value == null ? "" : ":"+required_value.toString());
|
return ((negated != null && negated) ? "NOT " : "")
|
||||||
|
+(type == null ? "" : type.toString()+":")
|
||||||
|
+(required_obj_id == null ? "" : required_obj_id+":")
|
||||||
|
+(required_value == null ? "" : required_value.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import java.util.Map;
|
|||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.swing.tree.TreeNode;
|
import javax.swing.tree.TreeNode;
|
||||||
|
|
||||||
|
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
||||||
import com.gpl.rpg.atcontentstudio.Notification;
|
import com.gpl.rpg.atcontentstudio.Notification;
|
||||||
import com.gpl.rpg.atcontentstudio.model.GameDataElement;
|
import com.gpl.rpg.atcontentstudio.model.GameDataElement;
|
||||||
import com.gpl.rpg.atcontentstudio.model.GameSource.Type;
|
import com.gpl.rpg.atcontentstudio.model.GameSource.Type;
|
||||||
@@ -174,7 +175,7 @@ public class Spritesheet extends GameDataElement {
|
|||||||
}
|
}
|
||||||
Image result = getImage(index);
|
Image result = getImage(index);
|
||||||
if (result == null) return null;
|
if (result == null) return null;
|
||||||
result = result.getScaledInstance(16, 16, BufferedImage.SCALE_SMOOTH);
|
result = result.getScaledInstance((int)(16*ATContentStudio.SCALING), (int)(16*ATContentStudio.SCALING), Image.SCALE_SMOOTH);
|
||||||
cache_icon.put(index, result);
|
cache_icon.put(index, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
|
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
||||||
import com.gpl.rpg.atcontentstudio.Notification;
|
import com.gpl.rpg.atcontentstudio.Notification;
|
||||||
|
|
||||||
public class DefaultIcons {
|
public class DefaultIcons {
|
||||||
@@ -107,6 +108,10 @@ public class DefaultIcons {
|
|||||||
public static Image getNPCImage() { return getImage(NPC_RES); }
|
public static Image getNPCImage() { return getImage(NPC_RES); }
|
||||||
public static Image getNPCIcon() { return getIcon(NPC_RES); }
|
public static Image getNPCIcon() { return getIcon(NPC_RES); }
|
||||||
|
|
||||||
|
private static String BONEMEAL_RES = "/com/gpl/rpg/atcontentstudio/img/bonemeal.png";
|
||||||
|
public static Image getBonemealImage() { return getImage(BONEMEAL_RES); }
|
||||||
|
public static Image getBonemealIcon() { return getIcon(BONEMEAL_RES); }
|
||||||
|
|
||||||
private static String NPC_CLOSE_RES = "/com/gpl/rpg/atcontentstudio/img/npc_close.png";
|
private static String NPC_CLOSE_RES = "/com/gpl/rpg/atcontentstudio/img/npc_close.png";
|
||||||
public static Image getNPCCloseImage() { return getImage(NPC_CLOSE_RES); }
|
public static Image getNPCCloseImage() { return getImage(NPC_CLOSE_RES); }
|
||||||
public static Image getNPCCloseIcon() { return getIcon(NPC_CLOSE_RES); }
|
public static Image getNPCCloseIcon() { return getIcon(NPC_CLOSE_RES); }
|
||||||
@@ -130,6 +135,14 @@ public class DefaultIcons {
|
|||||||
private static String GOLD_RES = "/com/gpl/rpg/atcontentstudio/img/ui_icon_coins.png";
|
private static String GOLD_RES = "/com/gpl/rpg/atcontentstudio/img/ui_icon_coins.png";
|
||||||
public static Image getGoldImage() { return getImage(GOLD_RES); }
|
public static Image getGoldImage() { return getImage(GOLD_RES); }
|
||||||
public static Image getGoldIcon() { return getIcon(GOLD_RES); }
|
public static Image getGoldIcon() { return getIcon(GOLD_RES); }
|
||||||
|
|
||||||
|
private static String SKILL_RES = "/com/gpl/rpg/atcontentstudio/img/ui_icon_skill.png";
|
||||||
|
public static Image getSkillImage() { return getImage(SKILL_RES); }
|
||||||
|
public static Image getSkillIcon() { return getIcon(SKILL_RES); }
|
||||||
|
|
||||||
|
private static String IMMUNITY_RES = "/com/gpl/rpg/atcontentstudio/img/ui_icon_immunity.png";
|
||||||
|
public static Image getImmunityImage() { return getImage(IMMUNITY_RES); }
|
||||||
|
public static Image getImmunityIcon() { return getIcon(IMMUNITY_RES); }
|
||||||
|
|
||||||
private static String ITEM_CATEGORY_RES = "/com/gpl/rpg/atcontentstudio/img/equip_weapon.png";
|
private static String ITEM_CATEGORY_RES = "/com/gpl/rpg/atcontentstudio/img/equip_weapon.png";
|
||||||
public static Image getItemCategoryImage() { return getImage(ITEM_CATEGORY_RES); }
|
public static Image getItemCategoryImage() { return getImage(ITEM_CATEGORY_RES); }
|
||||||
@@ -235,6 +248,14 @@ public class DefaultIcons {
|
|||||||
public static Image getZoomImage() { return getImage(ZOOM_RES); }
|
public static Image getZoomImage() { return getImage(ZOOM_RES); }
|
||||||
public static Image getZoomIcon() { return getIcon(ZOOM_RES); }
|
public static Image getZoomIcon() { return getIcon(ZOOM_RES); }
|
||||||
|
|
||||||
|
private static String TIMER_RES = "/com/gpl/rpg/atcontentstudio/img/timer.png";
|
||||||
|
public static Image getTimerImage() { return getImage(TIMER_RES); }
|
||||||
|
public static Image getTimerIcon() { return getIcon(TIMER_RES); }
|
||||||
|
|
||||||
|
private static String ALIGNMENT_RES = "/com/gpl/rpg/atcontentstudio/img/alignment.png";
|
||||||
|
public static Image getAlignmentImage() { return getImage(ALIGNMENT_RES); }
|
||||||
|
public static Image getAlignmentIcon() { return getIcon(ALIGNMENT_RES); }
|
||||||
|
|
||||||
private static String STATUS_RED_RES = "/com/gpl/rpg/atcontentstudio/img/status_red.png";
|
private static String STATUS_RED_RES = "/com/gpl/rpg/atcontentstudio/img/status_red.png";
|
||||||
public static Image getStatusRedImage() { return getImage(STATUS_RED_RES); }
|
public static Image getStatusRedImage() { return getImage(STATUS_RED_RES); }
|
||||||
public static Image getStatusRedIcon() { return getIcon(STATUS_RED_RES); }
|
public static Image getStatusRedIcon() { return getIcon(STATUS_RED_RES); }
|
||||||
@@ -271,7 +292,7 @@ public class DefaultIcons {
|
|||||||
|
|
||||||
private static Image getIcon(String res) {
|
private static Image getIcon(String res) {
|
||||||
if (iconCache.get(res) == null) {
|
if (iconCache.get(res) == null) {
|
||||||
Image icon = getImage(res).getScaledInstance(16, 16, Image.SCALE_SMOOTH);
|
Image icon = getImage(res).getScaledInstance((int)(16*ATContentStudio.SCALING), (int)(16*ATContentStudio.SCALING), Image.SCALE_SMOOTH);
|
||||||
iconCache.put(res, icon);
|
iconCache.put(res, icon);
|
||||||
}
|
}
|
||||||
return iconCache.get(res);
|
return iconCache.get(res);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import javax.swing.ListModel;
|
|||||||
import javax.swing.event.ListDataEvent;
|
import javax.swing.event.ListDataEvent;
|
||||||
import javax.swing.event.ListDataListener;
|
import javax.swing.event.ListDataListener;
|
||||||
|
|
||||||
|
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
||||||
import com.gpl.rpg.atcontentstudio.Notification;
|
import com.gpl.rpg.atcontentstudio.Notification;
|
||||||
import com.gpl.rpg.atcontentstudio.NotificationListener;
|
import com.gpl.rpg.atcontentstudio.NotificationListener;
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@ public class NotificationsPane extends JList {
|
|||||||
label.setBorder(BorderFactory.createLineBorder(Color.BLUE));
|
label.setBorder(BorderFactory.createLineBorder(Color.BLUE));
|
||||||
// label.setForeground(Color.WHITE);
|
// label.setForeground(Color.WHITE);
|
||||||
}
|
}
|
||||||
f = f.deriveFont(10f);
|
f = f.deriveFont(10f*ATContentStudio.SCALING);
|
||||||
label.setFont(f);
|
label.setFont(f);
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|||||||
35
src/com/gpl/rpg/atcontentstudio/ui/OverlayIcon.java
Normal file
35
src/com/gpl/rpg/atcontentstudio/ui/OverlayIcon.java
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
package com.gpl.rpg.atcontentstudio.ui;
|
||||||
|
|
||||||
|
import java.awt.Component;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.Image;
|
||||||
|
|
||||||
|
import javax.swing.Icon;
|
||||||
|
|
||||||
|
public class OverlayIcon implements Icon {
|
||||||
|
|
||||||
|
private Image background;
|
||||||
|
private Image overlay;
|
||||||
|
|
||||||
|
public OverlayIcon(Image background, Image overlay) {
|
||||||
|
this.background = background;
|
||||||
|
this.overlay = overlay;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||||
|
g.drawImage(background, x, y, null);
|
||||||
|
g.drawImage(overlay, x, y, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getIconWidth() {
|
||||||
|
return Math.max(background.getWidth(null), overlay.getWidth(null));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getIconHeight() {
|
||||||
|
return Math.max(background.getHeight(null), overlay.getHeight(null));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -40,7 +40,7 @@ public class StudioFrame extends JFrame {
|
|||||||
|
|
||||||
private static final long serialVersionUID = -3391514100319186661L;
|
private static final long serialVersionUID = -3391514100319186661L;
|
||||||
|
|
||||||
|
|
||||||
final ProjectsTree projectTree;
|
final ProjectsTree projectTree;
|
||||||
final EditorsArea editors;
|
final EditorsArea editors;
|
||||||
|
|
||||||
@@ -165,6 +165,7 @@ public class StudioFrame extends JFrame {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
try {
|
try {
|
||||||
UIManager.setLookAndFeel(i.getClassName());
|
UIManager.setLookAndFeel(i.getClassName());
|
||||||
|
ATContentStudio.scaleUIFont();
|
||||||
SwingUtilities.updateComponentTreeUI(ATContentStudio.frame);
|
SwingUtilities.updateComponentTreeUI(ATContentStudio.frame);
|
||||||
ConfigCache.setFavoriteLaFClassName(i.getClassName());
|
ConfigCache.setFavoriteLaFClassName(i.getClassName());
|
||||||
} catch (ClassNotFoundException e1) {
|
} catch (ClassNotFoundException e1) {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import javax.swing.JDialog;
|
|||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
||||||
import com.jidesoft.swing.JideBoxLayout;
|
import com.jidesoft.swing.JideBoxLayout;
|
||||||
|
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ private static final long serialVersionUID = 8239669104275145995L;
|
|||||||
super(parent, "Loading...");
|
super(parent, "Loading...");
|
||||||
this.setIconImage(DefaultIcons.getMainIconImage());
|
this.setIconImage(DefaultIcons.getMainIconImage());
|
||||||
this.getContentPane().setLayout(new JideBoxLayout(this.getContentPane(), JideBoxLayout.PAGE_AXIS, 6));
|
this.getContentPane().setLayout(new JideBoxLayout(this.getContentPane(), JideBoxLayout.PAGE_AXIS, 6));
|
||||||
this.getContentPane().add(new JLabel("<html><font size=5>Please wait.<br/>"+message+"</font></html>"), JideBoxLayout.VARY);
|
this.getContentPane().add(new JLabel("<html><font size="+(int)(5 * ATContentStudio.SCALING)+">Please wait.<br/>"+message+"</font></html>"), JideBoxLayout.VARY);
|
||||||
JMovingIdler idler = new JMovingIdler();
|
JMovingIdler idler = new JMovingIdler();
|
||||||
idler.setBackground(Color.WHITE);
|
idler.setBackground(Color.WHITE);
|
||||||
idler.setForeground(Color.GREEN);
|
idler.setForeground(Color.GREEN);
|
||||||
@@ -46,7 +47,7 @@ private static final long serialVersionUID = 8239669104275145995L;
|
|||||||
info.setVisible(true);
|
info.setVisible(true);
|
||||||
workload.run();
|
workload.run();
|
||||||
info.dispose();
|
info.dispose();
|
||||||
if (showConfirm) JOptionPane.showMessageDialog(parent, "<html><font size=5>Done !</font></html>");
|
if (showConfirm) JOptionPane.showMessageDialog(parent, "<html><font size="+(int)(5 * ATContentStudio.SCALING)+">Done !</font></html>");
|
||||||
};
|
};
|
||||||
}.start();
|
}.start();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,13 +35,15 @@ public class ActorConditionEditor extends JSONElementEditor {
|
|||||||
private IntegerBasedCheckBox positiveBox;
|
private IntegerBasedCheckBox positiveBox;
|
||||||
private IntegerBasedCheckBox stackingBox;
|
private IntegerBasedCheckBox stackingBox;
|
||||||
|
|
||||||
private JTextField roundVisualField;
|
//private JTextField roundVisualField;
|
||||||
|
private JComboBox roundVisualField;
|
||||||
private JSpinner roundHpMinField;
|
private JSpinner roundHpMinField;
|
||||||
private JSpinner roundHpMaxField;
|
private JSpinner roundHpMaxField;
|
||||||
private JSpinner roundApMinField;
|
private JSpinner roundApMinField;
|
||||||
private JSpinner roundApMaxField;
|
private JSpinner roundApMaxField;
|
||||||
|
|
||||||
private JTextField fullRoundVisualField;
|
//private JTextField fullRoundVisualField;
|
||||||
|
private JComboBox fullRoundVisualField;
|
||||||
private JSpinner fullRoundHpMinField;
|
private JSpinner fullRoundHpMinField;
|
||||||
private JSpinner fullRoundHpMaxField;
|
private JSpinner fullRoundHpMaxField;
|
||||||
private JSpinner fullRoundApMinField;
|
private JSpinner fullRoundApMinField;
|
||||||
@@ -82,7 +84,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
|||||||
stackingBox = addIntegerBasedCheckBox(pane, "Stacking", ac.stacking, ac.writable, listener);
|
stackingBox = addIntegerBasedCheckBox(pane, "Stacking", ac.stacking, ac.writable, listener);
|
||||||
|
|
||||||
|
|
||||||
CollapsiblePanel roundEffectPane = new CollapsiblePanel("Effect every round (4s): ");
|
CollapsiblePanel roundEffectPane = new CollapsiblePanel("Effect every round (6s): ");
|
||||||
roundEffectPane.setLayout(new JideBoxLayout(roundEffectPane, JideBoxLayout.PAGE_AXIS));
|
roundEffectPane.setLayout(new JideBoxLayout(roundEffectPane, JideBoxLayout.PAGE_AXIS));
|
||||||
final ActorCondition.RoundEffect roundEffect;
|
final ActorCondition.RoundEffect roundEffect;
|
||||||
if (ac.round_effect != null) {
|
if (ac.round_effect != null) {
|
||||||
@@ -90,7 +92,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
|||||||
} else {
|
} else {
|
||||||
roundEffect = new ActorCondition.RoundEffect();
|
roundEffect = new ActorCondition.RoundEffect();
|
||||||
}
|
}
|
||||||
roundVisualField = addTextField(roundEffectPane, "Visual effect ID: ", roundEffect.visual_effect, ac.writable, listener);
|
roundVisualField = addEnumValueBox(roundEffectPane, "Visual effect ID:", ActorCondition.VisualEffectID.values(), roundEffect.visual_effect, ac.writable, listener);//addTextField(roundEffectPane, "Visual effect ID: ", roundEffect.visual_effect, ac.writable, listener);
|
||||||
roundHpMinField = addIntegerField(roundEffectPane, "HP Bonus Min: ", roundEffect.hp_boost_min, true, ac.writable, listener);
|
roundHpMinField = addIntegerField(roundEffectPane, "HP Bonus Min: ", roundEffect.hp_boost_min, true, ac.writable, listener);
|
||||||
roundHpMaxField = addIntegerField(roundEffectPane, "HP Bonus Max: ", roundEffect.hp_boost_max, true, ac.writable, listener);
|
roundHpMaxField = addIntegerField(roundEffectPane, "HP Bonus Max: ", roundEffect.hp_boost_max, true, ac.writable, listener);
|
||||||
roundApMinField = addIntegerField(roundEffectPane, "AP Bonus Min: ", roundEffect.ap_boost_min, true, ac.writable, listener);
|
roundApMinField = addIntegerField(roundEffectPane, "AP Bonus Min: ", roundEffect.ap_boost_min, true, ac.writable, listener);
|
||||||
@@ -99,7 +101,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
|||||||
pane.add(roundEffectPane, JideBoxLayout.FIX);
|
pane.add(roundEffectPane, JideBoxLayout.FIX);
|
||||||
|
|
||||||
|
|
||||||
CollapsiblePanel fullRoundEffectPane = new CollapsiblePanel("Effect every full round (20s): ");
|
CollapsiblePanel fullRoundEffectPane = new CollapsiblePanel("Effect every full round (25s): ");
|
||||||
fullRoundEffectPane.setLayout(new JideBoxLayout(fullRoundEffectPane, JideBoxLayout.PAGE_AXIS));
|
fullRoundEffectPane.setLayout(new JideBoxLayout(fullRoundEffectPane, JideBoxLayout.PAGE_AXIS));
|
||||||
final ActorCondition.RoundEffect fullRoundEffect;
|
final ActorCondition.RoundEffect fullRoundEffect;
|
||||||
if (ac.full_round_effect != null) {
|
if (ac.full_round_effect != null) {
|
||||||
@@ -107,7 +109,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
|||||||
} else {
|
} else {
|
||||||
fullRoundEffect = new ActorCondition.RoundEffect();
|
fullRoundEffect = new ActorCondition.RoundEffect();
|
||||||
}
|
}
|
||||||
fullRoundVisualField = addTextField(fullRoundEffectPane, "Visual effect ID: ", fullRoundEffect.visual_effect, ac.writable, listener);
|
fullRoundVisualField = addEnumValueBox(fullRoundEffectPane, "Visual effect ID:", ActorCondition.VisualEffectID.values(), fullRoundEffect.visual_effect, ac.writable, listener);//addTextField(fullRoundEffectPane, "Visual effect ID: ", fullRoundEffect.visual_effect, ac.writable, listener);
|
||||||
fullRoundHpMinField = addIntegerField(fullRoundEffectPane, "HP Bonus min: ", fullRoundEffect.hp_boost_min, true, ac.writable, listener);
|
fullRoundHpMinField = addIntegerField(fullRoundEffectPane, "HP Bonus min: ", fullRoundEffect.hp_boost_min, true, ac.writable, listener);
|
||||||
fullRoundHpMaxField = addIntegerField(fullRoundEffectPane, "HP Bonus max: ", fullRoundEffect.hp_boost_max, true, ac.writable, listener);
|
fullRoundHpMaxField = addIntegerField(fullRoundEffectPane, "HP Bonus max: ", fullRoundEffect.hp_boost_max, true, ac.writable, listener);
|
||||||
fullRoundApMinField = addIntegerField(fullRoundEffectPane, "AP Bonus min: ", fullRoundEffect.ap_boost_min, true, ac.writable, listener);
|
fullRoundApMinField = addIntegerField(fullRoundEffectPane, "AP Bonus min: ", fullRoundEffect.ap_boost_min, true, ac.writable, listener);
|
||||||
@@ -194,7 +196,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
|||||||
if (aCond.round_effect == null) {
|
if (aCond.round_effect == null) {
|
||||||
aCond.round_effect = new ActorCondition.RoundEffect();
|
aCond.round_effect = new ActorCondition.RoundEffect();
|
||||||
}
|
}
|
||||||
aCond.round_effect.visual_effect = (String) value;
|
aCond.round_effect.visual_effect = (ActorCondition.VisualEffectID) value;
|
||||||
}
|
}
|
||||||
} else if (source == roundHpMinField) {
|
} else if (source == roundHpMinField) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
@@ -264,7 +266,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
|||||||
if (aCond.full_round_effect == null) {
|
if (aCond.full_round_effect == null) {
|
||||||
aCond.full_round_effect = new ActorCondition.RoundEffect();
|
aCond.full_round_effect = new ActorCondition.RoundEffect();
|
||||||
}
|
}
|
||||||
aCond.full_round_effect.visual_effect = (String) value;
|
aCond.full_round_effect.visual_effect = (ActorCondition.VisualEffectID) value;
|
||||||
}
|
}
|
||||||
} else if (source == fullRoundHpMinField) {
|
} else if (source == fullRoundHpMinField) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
|
import javax.swing.ButtonGroup;
|
||||||
import javax.swing.DefaultListCellRenderer;
|
import javax.swing.DefaultListCellRenderer;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
@@ -22,6 +23,7 @@ import javax.swing.JComponent;
|
|||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JList;
|
import javax.swing.JList;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JRadioButton;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
@@ -50,6 +52,7 @@ import com.gpl.rpg.atcontentstudio.ui.BooleanBasedCheckBox;
|
|||||||
import com.gpl.rpg.atcontentstudio.ui.CollapsiblePanel;
|
import com.gpl.rpg.atcontentstudio.ui.CollapsiblePanel;
|
||||||
import com.gpl.rpg.atcontentstudio.ui.DefaultIcons;
|
import com.gpl.rpg.atcontentstudio.ui.DefaultIcons;
|
||||||
import com.gpl.rpg.atcontentstudio.ui.FieldUpdateListener;
|
import com.gpl.rpg.atcontentstudio.ui.FieldUpdateListener;
|
||||||
|
import com.gpl.rpg.atcontentstudio.ui.OverlayIcon;
|
||||||
import com.gpl.rpg.atcontentstudio.ui.gamedataeditors.dialoguetree.DialogueGraphView;
|
import com.gpl.rpg.atcontentstudio.ui.gamedataeditors.dialoguetree.DialogueGraphView;
|
||||||
import com.jidesoft.swing.JideBoxLayout;
|
import com.jidesoft.swing.JideBoxLayout;
|
||||||
|
|
||||||
@@ -96,6 +99,9 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
private JComboBox rewardObjIdCombo;
|
private JComboBox rewardObjIdCombo;
|
||||||
private MyComboBox rewardObj;
|
private MyComboBox rewardObj;
|
||||||
private JComponent rewardValue;
|
private JComponent rewardValue;
|
||||||
|
private JRadioButton rewardConditionTimed;
|
||||||
|
private JRadioButton rewardConditionForever;
|
||||||
|
private JRadioButton rewardConditionClear;
|
||||||
|
|
||||||
private RepliesListModel repliesListModel;
|
private RepliesListModel repliesListModel;
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
@@ -114,6 +120,7 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
private JComboBox requirementTypeCombo;
|
private JComboBox requirementTypeCombo;
|
||||||
private JPanel requirementParamsPane;
|
private JPanel requirementParamsPane;
|
||||||
private MyComboBox requirementObj;
|
private MyComboBox requirementObj;
|
||||||
|
private JComboBox requirementSkill;
|
||||||
private JTextField requirementObjId;
|
private JTextField requirementObjId;
|
||||||
private JComponent requirementValue;
|
private JComponent requirementValue;
|
||||||
private BooleanBasedCheckBox requirementNegated;
|
private BooleanBasedCheckBox requirementNegated;
|
||||||
@@ -357,6 +364,7 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
if (rewardObj != null) {
|
if (rewardObj != null) {
|
||||||
removeElementListener(rewardObj);
|
removeElementListener(rewardObj);
|
||||||
}
|
}
|
||||||
|
boolean immunity = false;
|
||||||
if (reward.type != null) {
|
if (reward.type != null) {
|
||||||
switch (reward.type) {
|
switch (reward.type) {
|
||||||
case activateMapObjectGroup:
|
case activateMapObjectGroup:
|
||||||
@@ -383,12 +391,59 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
rewardObj = null;
|
rewardObj = null;
|
||||||
rewardValue = null;
|
rewardValue = null;
|
||||||
break;
|
break;
|
||||||
|
case actorConditionImmunity:
|
||||||
|
immunity = true;
|
||||||
case actorCondition:
|
case actorCondition:
|
||||||
|
|
||||||
rewardMap = null;
|
rewardMap = null;
|
||||||
rewardObjId = null;
|
rewardObjId = null;
|
||||||
rewardObjIdCombo = null;
|
rewardObjIdCombo = null;
|
||||||
rewardObj = addActorConditionBox(pane, ((Dialogue)target).getProject(), "Actor Condition: ", (ActorCondition) reward.reward_obj, writable, listener);
|
rewardObj = addActorConditionBox(pane, ((Dialogue)target).getProject(), "Actor Condition: ", (ActorCondition) reward.reward_obj, writable, listener);
|
||||||
rewardValue = addIntegerField(pane, "Duration: ", reward.reward_value, false, writable, listener);
|
rewardConditionTimed = new JRadioButton("For a number of rounds");
|
||||||
|
pane.add(rewardConditionTimed, JideBoxLayout.FIX);
|
||||||
|
rewardValue = addIntegerField(pane, "Duration: ", reward.reward_value, 1, false, writable, listener);
|
||||||
|
rewardConditionForever = new JRadioButton("Forever");
|
||||||
|
pane.add(rewardConditionForever, JideBoxLayout.FIX);
|
||||||
|
if (!immunity) {
|
||||||
|
rewardConditionClear = new JRadioButton("Clear actor condition");
|
||||||
|
pane.add(rewardConditionClear, JideBoxLayout.FIX);
|
||||||
|
}
|
||||||
|
|
||||||
|
ButtonGroup radioGroup = new ButtonGroup();
|
||||||
|
radioGroup.add(rewardConditionTimed);
|
||||||
|
radioGroup.add(rewardConditionForever);
|
||||||
|
if (!immunity) radioGroup.add(rewardConditionClear);
|
||||||
|
|
||||||
|
if (immunity) {
|
||||||
|
rewardConditionTimed.setSelected(reward.reward_value == null || (reward.reward_value != ActorCondition.DURATION_FOREVER && reward.reward_value != ActorCondition.MAGNITUDE_CLEAR));
|
||||||
|
rewardConditionForever.setSelected(reward.reward_value != null && reward.reward_value != ActorCondition.DURATION_FOREVER);
|
||||||
|
rewardConditionClear.setSelected(reward.reward_value != null && reward.reward_value != ActorCondition.MAGNITUDE_CLEAR);
|
||||||
|
} else {
|
||||||
|
rewardConditionTimed.setSelected(reward.reward_value != null && reward.reward_value != ActorCondition.DURATION_FOREVER);
|
||||||
|
rewardConditionForever.setSelected(reward.reward_value == null || reward.reward_value == ActorCondition.DURATION_FOREVER);
|
||||||
|
}
|
||||||
|
rewardValue.setEnabled(rewardConditionTimed.isSelected());
|
||||||
|
|
||||||
|
rewardConditionTimed.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
listener.valueChanged(rewardConditionTimed, new Boolean(rewardConditionTimed.isSelected()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
rewardConditionForever.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
listener.valueChanged(rewardConditionForever, new Boolean(rewardConditionForever.isSelected()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!immunity) {
|
||||||
|
rewardConditionClear.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
listener.valueChanged(rewardConditionClear, new Boolean(rewardConditionClear.isSelected()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case alignmentChange:
|
case alignmentChange:
|
||||||
rewardMap = null;
|
rewardMap = null;
|
||||||
@@ -426,9 +481,13 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
rewardValue = addQuestStageBox(pane, ((Dialogue)target).getProject(), "Quest stage: ", reward.reward_value, writable, listener, (Quest) reward.reward_obj, rewardObj);
|
rewardValue = addQuestStageBox(pane, ((Dialogue)target).getProject(), "Quest stage: ", reward.reward_value, writable, listener, (Quest) reward.reward_obj, rewardObj);
|
||||||
break;
|
break;
|
||||||
case skillIncrease:
|
case skillIncrease:
|
||||||
|
Requirement.SkillID skillId = null;
|
||||||
|
try {
|
||||||
|
skillId = reward.reward_obj_id == null ? null : Requirement.SkillID.valueOf(reward.reward_obj_id);
|
||||||
|
} catch(IllegalArgumentException e) {}
|
||||||
rewardMap = null;
|
rewardMap = null;
|
||||||
rewardObjId = addTextField(pane, "Skill ID: ", reward.reward_obj_id, writable, listener);
|
rewardObjId = null;// addTextField(pane, "Skill ID: ", reward.reward_obj_id, writable, listener);
|
||||||
rewardObjIdCombo = null;
|
rewardObjIdCombo = addEnumValueBox(pane, "Skill ID: ", Requirement.SkillID.values(), skillId, writable, listener);
|
||||||
rewardObj = null;
|
rewardObj = null;
|
||||||
rewardValue = null;
|
rewardValue = null;
|
||||||
break;
|
break;
|
||||||
@@ -684,8 +743,13 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
requirementValue = addQuestStageBox(pane, project, "Quest stage: ", requirement.required_value, writable, listener, (Quest) requirement.required_obj, requirementObj);
|
requirementValue = addQuestStageBox(pane, project, "Quest stage: ", requirement.required_value, writable, listener, (Quest) requirement.required_obj, requirementObj);
|
||||||
break;
|
break;
|
||||||
case skillLevel:
|
case skillLevel:
|
||||||
|
Requirement.SkillID skillId = null;
|
||||||
|
try {
|
||||||
|
skillId = requirement.required_obj_id == null ? null : Requirement.SkillID.valueOf(requirement.required_obj_id);
|
||||||
|
} catch(IllegalArgumentException e) {}
|
||||||
requirementObj = null;
|
requirementObj = null;
|
||||||
requirementObjId = addTextField(pane, "Skill ID:", requirement.required_obj_id, writable, listener);
|
requirementSkill = addEnumValueBox(pane, "Skill ID:", Requirement.SkillID.values(), skillId, writable, listener);
|
||||||
|
requirementObjId = null;//addTextField(pane, "Skill ID:", requirement.required_obj_id, writable, listener);
|
||||||
requirementValue = addIntegerField(pane, "Level: ", requirement.required_value, false, writable, listener);
|
requirementValue = addIntegerField(pane, "Level: ", requirement.required_value, false, writable, listener);
|
||||||
break;
|
break;
|
||||||
case timerElapsed:
|
case timerElapsed:
|
||||||
@@ -693,6 +757,11 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
requirementObjId = addTextField(pane, "Timer ID:", requirement.required_obj_id, writable, listener);
|
requirementObjId = addTextField(pane, "Timer ID:", requirement.required_obj_id, writable, listener);
|
||||||
requirementValue = addIntegerField(pane, "Timer value: ", requirement.required_value, false, writable, listener);
|
requirementValue = addIntegerField(pane, "Timer value: ", requirement.required_value, false, writable, listener);
|
||||||
break;
|
break;
|
||||||
|
case factionScore:
|
||||||
|
requirementObj = null;
|
||||||
|
requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener);
|
||||||
|
requirementValue = addIntegerField(pane, "Minimum score: ", requirement.required_value, true, writable, listener);
|
||||||
|
break;
|
||||||
case wear:
|
case wear:
|
||||||
requirementObj = addItemBox(pane, project, "Item: ", (Item) requirement.required_obj, writable, listener);
|
requirementObj = addItemBox(pane, project, "Item: ", (Item) requirement.required_obj, writable, listener);
|
||||||
requirementObjId = null;
|
requirementObjId = null;
|
||||||
@@ -798,14 +867,27 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
label.setIcon(new ImageIcon(DefaultIcons.getObjectLayerIcon()));
|
label.setIcon(new ImageIcon(DefaultIcons.getObjectLayerIcon()));
|
||||||
break;
|
break;
|
||||||
case actorCondition:
|
case actorCondition:
|
||||||
label.setText("Give actor condition "+rewardObjDesc+" for "+reward.reward_value+" turns");
|
boolean rewardClear = reward.reward_value != null && reward.reward_value.intValue() == ActorCondition.MAGNITUDE_CLEAR;
|
||||||
|
if (rewardClear) {
|
||||||
|
label.setText("Clear actor condition "+rewardObjDesc);
|
||||||
|
} else {
|
||||||
|
boolean rewardForever = reward.reward_value != null && reward.reward_value.intValue() == ActorCondition.DURATION_FOREVER;
|
||||||
|
label.setText("Give actor condition "+rewardObjDesc+(rewardForever ? " forever" : " for "+reward.reward_value+" turns"));
|
||||||
|
}
|
||||||
if (reward.reward_obj != null) label.setIcon(new ImageIcon(reward.reward_obj.getIcon()));
|
if (reward.reward_obj != null) label.setIcon(new ImageIcon(reward.reward_obj.getIcon()));
|
||||||
break;
|
break;
|
||||||
|
case actorConditionImmunity:
|
||||||
|
boolean rewardForever = reward.reward_value == null || reward.reward_value.intValue() == ActorCondition.DURATION_FOREVER;
|
||||||
|
label.setText("Give immunity to actor condition "+rewardObjDesc+(rewardForever ? " forever" : " for "+reward.reward_value+" turns"));
|
||||||
|
if (reward.reward_obj != null) label.setIcon(new OverlayIcon(reward.reward_obj.getIcon(), DefaultIcons.getImmunityIcon()));
|
||||||
|
break;
|
||||||
case alignmentChange:
|
case alignmentChange:
|
||||||
label.setText("Change alignment for faction "+rewardObjDesc+" : "+reward.reward_value);
|
label.setText("Change alignment for faction "+rewardObjDesc+" : "+reward.reward_value);
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getAlignmentIcon()));
|
||||||
break;
|
break;
|
||||||
case createTimer:
|
case createTimer:
|
||||||
label.setText("Create timer "+rewardObjDesc);
|
label.setText("Create timer "+rewardObjDesc);
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getTimerIcon()));
|
||||||
break;
|
break;
|
||||||
case deactivateMapObjectGroup:
|
case deactivateMapObjectGroup:
|
||||||
label.setText("Deactivate map object group "+rewardObjDesc+" on map "+reward.map_name);
|
label.setText("Deactivate map object group "+rewardObjDesc+" on map "+reward.map_name);
|
||||||
@@ -837,6 +919,7 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
break;
|
break;
|
||||||
case skillIncrease:
|
case skillIncrease:
|
||||||
label.setText("Increase skill "+rewardObjDesc+" level");
|
label.setText("Increase skill "+rewardObjDesc+" level");
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getSkillIcon()));
|
||||||
break;
|
break;
|
||||||
case spawnAll:
|
case spawnAll:
|
||||||
label.setText("Respawn all monsters in spawnarea area "+rewardObjDesc+" on map "+reward.map_name);
|
label.setText("Respawn all monsters in spawnarea area "+rewardObjDesc+" on map "+reward.map_name);
|
||||||
@@ -1071,7 +1154,18 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
if (req.required_obj.getIcon() != null) {
|
if (req.required_obj.getIcon() != null) {
|
||||||
label.setIcon(new ImageIcon(req.required_obj.getIcon()));
|
label.setIcon(new ImageIcon(req.required_obj.getIcon()));
|
||||||
}
|
}
|
||||||
} if (req.type == null) {
|
} else if (req.type == Requirement.RequirementType.skillLevel) {
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getSkillIcon()));
|
||||||
|
} else if (req.type == Requirement.RequirementType.spentGold) {
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getGoldIcon()));
|
||||||
|
} else if (req.type == Requirement.RequirementType.consumedBonemeals) {
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getBonemealIcon()));
|
||||||
|
} else if (req.type == Requirement.RequirementType.timerElapsed) {
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getTimerIcon()));
|
||||||
|
} else if (req.type == Requirement.RequirementType.factionScore) {
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getAlignmentIcon()));
|
||||||
|
}
|
||||||
|
if (req.type == null) {
|
||||||
label.setText("New, undefined requirement.");
|
label.setText("New, undefined requirement.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1171,6 +1265,18 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
if (stage != null) stage.addBacklink(dialogue);
|
if (stage != null) stage.addBacklink(dialogue);
|
||||||
}
|
}
|
||||||
rewardsListModel.itemChanged(selectedReward);
|
rewardsListModel.itemChanged(selectedReward);
|
||||||
|
} else if (source == rewardConditionClear) {
|
||||||
|
selectedReward.reward_value = ActorCondition.MAGNITUDE_CLEAR;
|
||||||
|
rewardValue.setEnabled(false);
|
||||||
|
rewardsListModel.itemChanged(selectedReward);
|
||||||
|
} else if (source == rewardConditionForever) {
|
||||||
|
selectedReward.reward_value = ActorCondition.DURATION_FOREVER;
|
||||||
|
rewardValue.setEnabled(false);
|
||||||
|
rewardsListModel.itemChanged(selectedReward);
|
||||||
|
} else if (source == rewardConditionTimed) {
|
||||||
|
selectedReward.reward_value = (Integer) ((JSpinner)rewardValue).getValue();
|
||||||
|
rewardValue.setEnabled(true);
|
||||||
|
rewardsListModel.itemChanged(selectedReward);
|
||||||
} else if (source == replyTypeCombo) {
|
} else if (source == replyTypeCombo) {
|
||||||
updateRepliesParamsEditorPane(repliesParamsPane, selectedReply, this);
|
updateRepliesParamsEditorPane(repliesParamsPane, selectedReply, this);
|
||||||
repliesListModel.itemChanged(selectedReply);
|
repliesListModel.itemChanged(selectedReply);
|
||||||
@@ -1205,6 +1311,15 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
selectedRequirement.required_obj_id = null;
|
selectedRequirement.required_obj_id = null;
|
||||||
}
|
}
|
||||||
requirementsListModel.itemChanged(selectedRequirement);
|
requirementsListModel.itemChanged(selectedRequirement);
|
||||||
|
} else if (source == requirementSkill) {
|
||||||
|
if (selectedRequirement.required_obj != null) {
|
||||||
|
selectedRequirement.required_obj.removeBacklink(dialogue);
|
||||||
|
selectedRequirement.required_obj = null;
|
||||||
|
}
|
||||||
|
if (selectedRequirement.type == Requirement.RequirementType.skillLevel) {
|
||||||
|
selectedRequirement.required_obj_id = value == null ? null : value.toString();
|
||||||
|
}
|
||||||
|
requirementsListModel.itemChanged(selectedRequirement);
|
||||||
} else if (source == requirementObjId) {
|
} else if (source == requirementObjId) {
|
||||||
selectedRequirement.required_obj_id = (String) value;
|
selectedRequirement.required_obj_id = (String) value;
|
||||||
selectedRequirement.required_obj = null;
|
selectedRequirement.required_obj = null;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -95,6 +95,7 @@ public abstract class JSONElementEditor extends Editor {
|
|||||||
jsonEditorPane.setText(((JSONElement)target).toJsonString());
|
jsonEditorPane.setText(((JSONElement)target).toJsonString());
|
||||||
jsonEditorPane.setEditable(((JSONElement)target).writable);
|
jsonEditorPane.setEditable(((JSONElement)target).writable);
|
||||||
jsonEditorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JSON);
|
jsonEditorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JSON);
|
||||||
|
jsonEditorPane.setFont(jsonEditorPane.getFont().deriveFont(ATContentStudio.SCALING * jsonEditorPane.getFont().getSize()));
|
||||||
JPanel result = new JPanel();
|
JPanel result = new JPanel();
|
||||||
result.setLayout(new BorderLayout());
|
result.setLayout(new BorderLayout());
|
||||||
result.add(jsonEditorPane, BorderLayout.CENTER);
|
result.add(jsonEditorPane, BorderLayout.CENTER);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -697,8 +697,12 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
|||||||
requirementValue = addQuestStageBox(pane, project, "Quest stage: ", requirement.required_value, writable, listener, (Quest) requirement.required_obj, requirementObj);
|
requirementValue = addQuestStageBox(pane, project, "Quest stage: ", requirement.required_value, writable, listener, (Quest) requirement.required_obj, requirementObj);
|
||||||
break;
|
break;
|
||||||
case skillLevel:
|
case skillLevel:
|
||||||
requirementObj = null;
|
Requirement.SkillID skillId = null;
|
||||||
requirementObjId = addTextField(pane, "Skill ID:", requirement.required_obj_id, writable, listener);
|
try {
|
||||||
|
skillId = requirement.required_obj_id == null ? null : Requirement.SkillID.valueOf(requirement.required_obj_id);
|
||||||
|
} catch(IllegalArgumentException e) {}
|
||||||
|
requirementObj = addEnumValueBox(pane, "Skill ID:", Requirement.SkillID.values(), skillId, writable, listener);
|
||||||
|
requirementObjId = null;//addTextField(pane, "Skill ID:", requirement.required_obj_id, writable, listener);
|
||||||
requirementValue = addIntegerField(pane, "Level: ", requirement.required_value, false, writable, listener);
|
requirementValue = addIntegerField(pane, "Level: ", requirement.required_value, false, writable, listener);
|
||||||
break;
|
break;
|
||||||
case timerElapsed:
|
case timerElapsed:
|
||||||
@@ -706,6 +710,11 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
|||||||
requirementObjId = addTextField(pane, "Timer ID:", requirement.required_obj_id, writable, listener);
|
requirementObjId = addTextField(pane, "Timer ID:", requirement.required_obj_id, writable, listener);
|
||||||
requirementValue = addIntegerField(pane, "Timer value: ", requirement.required_value, false, writable, listener);
|
requirementValue = addIntegerField(pane, "Timer value: ", requirement.required_value, false, writable, listener);
|
||||||
break;
|
break;
|
||||||
|
case factionScore:
|
||||||
|
requirementObj = null;
|
||||||
|
requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener);
|
||||||
|
requirementValue = addIntegerField(pane, "Minimum score: ", requirement.required_value, true, writable, listener);
|
||||||
|
break;
|
||||||
case wear:
|
case wear:
|
||||||
requirementObj = addItemBox(pane, project, "Item: ", (Item) requirement.required_obj, writable, listener);
|
requirementObj = addItemBox(pane, project, "Item: ", (Item) requirement.required_obj, writable, listener);
|
||||||
requirementObjId = null;
|
requirementObjId = null;
|
||||||
@@ -756,6 +765,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
|||||||
editorPane.setText(((TMXMap)target).toXml());
|
editorPane.setText(((TMXMap)target).toXml());
|
||||||
editorPane.setEditable(false);
|
editorPane.setEditable(false);
|
||||||
editorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
|
editorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
|
||||||
|
editorPane.setFont(editorPane.getFont().deriveFont(ATContentStudio.SCALING * editorPane.getFont().getSize()));
|
||||||
pane.add(editorPane, JideBoxLayout.VARY);
|
pane.add(editorPane, JideBoxLayout.VARY);
|
||||||
|
|
||||||
return pane;
|
return pane;
|
||||||
@@ -2006,11 +2016,15 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
|||||||
} else if (source == requirementObj) {
|
} else if (source == requirementObj) {
|
||||||
if (selectedMapObject instanceof KeyArea) {
|
if (selectedMapObject instanceof KeyArea) {
|
||||||
KeyArea area = (KeyArea) selectedMapObject;
|
KeyArea area = (KeyArea) selectedMapObject;
|
||||||
area.requirement.required_obj = (GameDataElement) value;
|
if (area.requirement.type == Requirement.RequirementType.skillLevel) {
|
||||||
if (area.requirement.required_obj != null) {
|
area.requirement.required_obj_id = value == null ? null : value.toString();
|
||||||
area.requirement.required_obj_id = area.requirement.required_obj.id;
|
|
||||||
} else {
|
} else {
|
||||||
area.requirement.required_obj_id = null;
|
area.requirement.required_obj = (GameDataElement) value;
|
||||||
|
if (area.requirement.required_obj != null) {
|
||||||
|
area.requirement.required_obj_id = area.requirement.required_obj.id;
|
||||||
|
} else {
|
||||||
|
area.requirement.required_obj_id = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (area.oldSchoolRequirement) {
|
if (area.oldSchoolRequirement) {
|
||||||
area.updateNameFromRequirementChange();
|
area.updateNameFromRequirementChange();
|
||||||
@@ -2019,11 +2033,15 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
|||||||
}
|
}
|
||||||
} else if (selectedMapObject instanceof ReplaceArea) {
|
} else if (selectedMapObject instanceof ReplaceArea) {
|
||||||
ReplaceArea area = (ReplaceArea) selectedMapObject;
|
ReplaceArea area = (ReplaceArea) selectedMapObject;
|
||||||
area.requirement.required_obj = (GameDataElement) value;
|
if (area.requirement.type == Requirement.RequirementType.skillLevel) {
|
||||||
if (area.requirement.required_obj != null) {
|
area.requirement.required_obj_id = value == null ? null : value.toString();
|
||||||
area.requirement.required_obj_id = area.requirement.required_obj.id;
|
|
||||||
} else {
|
} else {
|
||||||
area.requirement.required_obj_id = null;
|
area.requirement.required_obj = (GameDataElement) value;
|
||||||
|
if (area.requirement.required_obj != null) {
|
||||||
|
area.requirement.required_obj_id = area.requirement.required_obj.id;
|
||||||
|
} else {
|
||||||
|
area.requirement.required_obj_id = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (area.oldSchoolRequirement) {
|
if (area.oldSchoolRequirement) {
|
||||||
area.updateNameFromRequirementChange();
|
area.updateNameFromRequirementChange();
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
|
|||||||
editorPane.setText(((WorldmapSegment)target).toXml());
|
editorPane.setText(((WorldmapSegment)target).toXml());
|
||||||
editorPane.setEditable(false);
|
editorPane.setEditable(false);
|
||||||
editorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
|
editorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
|
||||||
|
editorPane.setFont(editorPane.getFont().deriveFont(ATContentStudio.SCALING * editorPane.getFont().getSize()));
|
||||||
pane.add(editorPane, JideBoxLayout.VARY);
|
pane.add(editorPane, JideBoxLayout.VARY);
|
||||||
|
|
||||||
return pane;
|
return pane;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class DesktopIntegration {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Runtime.getRuntime().exec(Workspace.activeWorkspace.settings.mapEditorCommand.getCurrentValue()+" "+f.getAbsolutePath());
|
Runtime.getRuntime().exec(Workspace.activeWorkspace.settings.mapEditorCommand.getCurrentValue()+" \""+f.getAbsolutePath()+"\"");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ public class DesktopIntegration {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Runtime.getRuntime().exec(Workspace.activeWorkspace.settings.imageEditorCommand.getCurrentValue()+" "+f.getAbsolutePath());
|
Runtime.getRuntime().exec(Workspace.activeWorkspace.settings.imageEditorCommand.getCurrentValue()+" \""+f.getAbsolutePath()+"\"");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user