Merge conflict resolve

This commit is contained in:
CharonInferar
2014-08-09 18:17:01 +02:00
1452 changed files with 14987 additions and 14349 deletions
+90 -10
View File
@@ -121,7 +121,10 @@ public class BuffService implements INetworkDispatch {
Buff buff = buffMap.get(buffName);
if(buff == null) return false;
if(buff == null)
{
return false;
}
// Here the necessary checks must be placed to prevent buffs from the same buff group (e.g. Buff D) being stacked!
@@ -141,6 +144,10 @@ public class BuffService implements INetworkDispatch {
public Buff doAddBuff(final CreatureObject target, String buffName, final CreatureObject buffer) {
//BUG HERE !! watch it
//TODO fix this -- !! this is wrong - I can buff from 5,5 in cantina someone sitting at 20,20 in the universe/planet !!! - accross the galaxy/planet
//cause get position is relative to creature system of coordinates - when one's outside and other inside
//if you must use getPosition() check for isInCell first for both or something like that
if (target.getPosition().getDistance(buffer.getPosition()) > 20) {
return null;
}
@@ -155,10 +162,24 @@ public class BuffService implements INetworkDispatch {
else
buff.setTotalPlayTime(0);
if(FileUtilities.doesFileExist("scripts/buffs/" + buffName + ".py")) core.scriptService.callScript("scripts/buffs/", buffName, "setup", core, buffer, buff);
if(FileUtilities.doesFileExist("scripts/buffs/" + buffName + ".py"))
{
if(!buffName.equals("buildabuff_inspiration"))
{
core.scriptService.callScript("scripts/buffs/", buffName, "setup", core, buffer, buff);
}
else
{
//!!! for special case inspiration , workshop is attached to target
core.scriptService.callScript("scripts/buffs/", buffName, "add", core, target, buff);
}
}
for (final Buff otherBuff : target.getBuffList()) {
if (buff.getGroup1().equals(otherBuff.getGroup1()))
if (buff.getGroup1().equals(otherBuff.getGroup1()))
if (buff.getPriority() >= otherBuff.getPriority()) {
if (buff.getBuffName().equals(otherBuff.getBuffName()))
{
@@ -178,14 +199,20 @@ public class BuffService implements INetworkDispatch {
if (buff.getDuration() != -1.0)
if (otherBuff.getRemainingDuration() > buff.getDuration() && otherBuff.getStacks() >= otherBuff.getMaxStacks())
return null;
<<<<<<< HEAD
}
// else {
// removeBuffFromCreature(target, otherBuff); // Seems more logical ToDo: Verify!!!
// }
removeBuffFromCreature(target, otherBuff); // Moved to else, otherwise buff will not stack
=======
}
removeBuffFromCreature(target, otherBuff);
>>>>>>> origin/master
break;
} else {
System.out.println("buff not added:" + buffName);
} else
{
return null;
}
}
@@ -262,9 +289,12 @@ public class BuffService implements INetworkDispatch {
}
@SuppressWarnings("unused")
public void removeBuffFromCreature(CreatureObject creature, Buff buff) {
public void removeBuffFromCreature(CreatureObject creature, Buff buff)
{
if(!creature.getBuffList().contains(buff))
return;
{
return;
}
DamageOverTime dot = creature.getDotByBuff(buff);
if(dot != null) {
dot.getTask().cancel(true);
@@ -274,6 +304,7 @@ public class BuffService implements INetworkDispatch {
/* if(FileUtilities.doesFileExist("scripts/buffs/" + buff.getBuffName() + ".py")) core.scriptService.callScript("scripts/buffs/", buff.getBuffName(), "remove", core, creature, buff);
else
{*/
<<<<<<< HEAD
if(buff.getEffect1Name().length() > 0) core.skillModService.deductSkillMod(creature, buff.getEffect1Name(), (int) buff.getEffect1Value());
if(buff.getEffect2Name().length() > 0) core.skillModService.deductSkillMod(creature, buff.getEffect2Name(), (int) buff.getEffect2Value());
if(buff.getEffect1Name().length() > 0) core.skillModService.deductSkillMod(creature, buff.getEffect3Name(), (int) buff.getEffect3Value());
@@ -286,8 +317,42 @@ public class BuffService implements INetworkDispatch {
}
}
// }
=======
>>>>>>> origin/master
if (!buff.getCallback().equals("none") && !buff.getCallback().equals("")) {
if(buff.getEffect1Name().length() > 0)
{
core.skillModService.deductSkillMod(creature, buff.getEffect1Name(), (int) buff.getEffect1Value());
}
if(buff.getEffect2Name().length() > 0)
{
core.skillModService.deductSkillMod(creature, buff.getEffect2Name(), (int) buff.getEffect2Value());
}
if(buff.getEffect3Name().length() > 0)
{
core.skillModService.deductSkillMod(creature, buff.getEffect3Name(), (int) buff.getEffect3Value());
}
if(buff.getEffect4Name().length() > 0)
{
core.skillModService.deductSkillMod(creature, buff.getEffect4Name(), (int) buff.getEffect4Value());
}
if(buff.getEffect5Name().length() > 0)
{
core.skillModService.deductSkillMod(creature, buff.getEffect5Name(), (int) buff.getEffect5Value());
}
// }
// ??? callback for what ? toggle buff ?
if (!buff.getCallback().equals("none") && !buff.getCallback().equals(""))
{
if (FileUtilities.doesFileExist("scripts/buffs/" + buff.getBuffName() + ".py")) {
PyObject method = core.scriptService.getMethod("scripts/buffs/", buff.getBuffName(), buff.getCallback());
@@ -296,6 +361,19 @@ public class BuffService implements INetworkDispatch {
}
}
}
//remove method is more like it
else
{
if (FileUtilities.doesFileExist("scripts/buffs/" + buff.getBuffName() + ".py"))
{
PyObject method = core.scriptService.getMethod("scripts/buffs/", buff.getBuffName(), "remove");
if (method != null && method.isCallable())
{
method.__call__(Py.java2py(core), Py.java2py(creature), Py.java2py(buff));
}
}
}
creature.removeBuff(buff);
for (String effect : buff.getParticleEffect().split(",")) {
@@ -381,14 +459,16 @@ public class BuffService implements INetworkDispatch {
public void addGroupBuff(CreatureObject target, String buffName, CreatureObject buffer) {
if(buffer.getGroupId() == 0) {
if(buffer.getGroupId() == 0)
{
doAddBuff(target, buffName, buffer);
return;
}
GroupObject group = (GroupObject) core.objectService.getObject(buffer.getGroupId());
if(group == null) {
if(group == null)
{
doAddBuff(target, buffName, buffer);
return;
}