mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-20 10:02:56 -04:00
Merge branch 'master' of https://github.com/ProjectSWGCore/NGECore2
This commit is contained in:
@@ -22,11 +22,5 @@ def run(core, actor, target, commandString):
|
||||
if actor.getPerformanceId() <= 0:
|
||||
actor.sendSystemMessage('@performance:flourish_not_performing', 0)
|
||||
return
|
||||
|
||||
actor.incFlourishCount()
|
||||
actor.sendSystemMessage('@performance:flourish_perform', 0)
|
||||
animation = 'skill_action_' + str(flourish)
|
||||
if flourish == 9:
|
||||
animation = 'mistake'
|
||||
|
||||
actor.doSkillAnimation(animation)
|
||||
core.entertainmentService.performFlourish(actor, flourish)
|
||||
@@ -4,6 +4,7 @@ from services.sui.SUIWindow import Trigger
|
||||
from services.sui.SUIService import ListBoxType
|
||||
from java.util import Vector
|
||||
from java.util import HashMap
|
||||
from resources.datatables import Posture
|
||||
import sys
|
||||
|
||||
def setup():
|
||||
@@ -26,7 +27,6 @@ def run(core, actor, target, commandString):
|
||||
else:
|
||||
|
||||
availableDances = entSvc.getAvailableDances(actor)
|
||||
print availableDances
|
||||
|
||||
suiSvc = core.suiService
|
||||
suiWindow = suiSvc.createListBox(ListBoxType.LIST_BOX_OK_CANCEL, "@performance:select_dance", "@performance:available_dances", availableDances, actor, None, 10)
|
||||
@@ -74,8 +74,13 @@ def startDance(core, actor, danceName, visual):
|
||||
actor.sendSystemMessage('@performance:already_performing_self',0)
|
||||
return
|
||||
|
||||
#TODO: check costume, posture, etc?
|
||||
|
||||
#TODO: check costume
|
||||
|
||||
if actor.getPosture() != Posture.Upright:
|
||||
print (' can\t dance because ' + str(actor.getPosture()))
|
||||
actor.sendSystemMessage('@performance:dance_fail', 0)
|
||||
return
|
||||
|
||||
actor.sendSystemMessage('@performance:dance_start_self',0);
|
||||
# i'm not sure about this. i think stopping just stopped any watchers anyways
|
||||
# method doesn't exist now.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
def setup(core, object):
|
||||
object.setAttachment('radial_filename', 'player')
|
||||
return
|
||||
@@ -0,0 +1,23 @@
|
||||
from resources.common import RadialOptions
|
||||
from resources.datatables import Posture
|
||||
import sys
|
||||
|
||||
def createRadial(core, owner, target, radials):
|
||||
if target.getPosture() == Posture.SkillAnimating:
|
||||
if target.getPerformanceType() is True:
|
||||
radials.add(RadialOptions(0, 140, 1, 'Watch'))
|
||||
else:
|
||||
radials.add(RadialOptions(0, 140, 1, 'Listen'))
|
||||
|
||||
return
|
||||
|
||||
def handleSelection(core, owner, target, option):
|
||||
if option == 140:
|
||||
if target.getPerformanceType() is True:
|
||||
core.commandService.callCommand(owner, 'watch', target, '')
|
||||
return
|
||||
else:
|
||||
# TODO: Insert callCommand /listen
|
||||
return
|
||||
return
|
||||
return
|
||||
@@ -14,6 +14,8 @@ def createRadial(core, owner, target, radials):
|
||||
if ghost.getSpouseName() is None or ghost.getSpouseName() is "":
|
||||
targetPlayer = core.objectService.getObject(owner.getTargetId())
|
||||
if targetPlayer is not None and targetPlayer.getSlottedObject('ghost') is not None:
|
||||
if targetPlayer.getObjectID() is owner.getObjectID():
|
||||
return
|
||||
radials.add(RadialOptions(0, 69, 1, '@unity:mnu_propose'))
|
||||
return
|
||||
else:
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package resources.datatables;
|
||||
|
||||
public class Posture {
|
||||
// Posture.iff
|
||||
public static final int Invalid = -1;
|
||||
public static final int Upright = 0;
|
||||
public static final int Crouched = 1;
|
||||
public static final int Prone = 2;
|
||||
public static final int Sneaking = 3;
|
||||
public static final int Blocking = 4;
|
||||
public static final int Climbing = 5;
|
||||
public static final int Flying = 6;
|
||||
public static final int LyingDown = 7;
|
||||
public static final int Sitting = 8;
|
||||
public static final int SkillAnimating = 9;
|
||||
public static final int DrivingVehicle = 10;
|
||||
public static final int RidingCreature = 11;
|
||||
public static final int KnockedDown = 12;
|
||||
public static final int Incapacitated = 13;
|
||||
public static final int Dead = 14;
|
||||
}
|
||||
@@ -356,11 +356,10 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
this.posture = posture;
|
||||
}
|
||||
|
||||
IoBuffer postureDelta = messageBuilder.buildPostureDelta(posture);
|
||||
Posture postureUpdate = new Posture(getObjectID(), posture);
|
||||
ObjControllerMessage objController = new ObjControllerMessage(0x1B, postureUpdate);
|
||||
|
||||
notifyObservers(postureDelta, true);
|
||||
notifyObservers(messageBuilder.buildPostureDelta(posture), true);
|
||||
notifyObservers(objController, true);
|
||||
|
||||
if (needsStopPerformance) {
|
||||
@@ -378,6 +377,7 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
public void stopPerformance() {
|
||||
String type = "";
|
||||
synchronized(objectMutex) {
|
||||
// TODO: Minimum check to wait for song to finish before stopping... ?
|
||||
setPerformanceId(0,true);
|
||||
setPerformanceCounter(0);
|
||||
setCurrentAnimation("");
|
||||
@@ -414,7 +414,8 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
next.setMoodAnimation("");
|
||||
}
|
||||
if (next == this) { continue; }
|
||||
next.sendSystemMessage("@performance:" + type + "_stop_other",(byte)0);
|
||||
if(performanceType) { next.sendSystemMessage("You stop watching " + getCustomName() + ".",(byte)0); }
|
||||
else { next.sendSystemMessage("You stop listening to " + getCustomName() + ".",(byte)0); }
|
||||
next.getSpectatorTask().cancel(true);
|
||||
}
|
||||
//not sure if this behaviour is correct. might need fixing later.
|
||||
|
||||
@@ -429,8 +429,7 @@ public class EntertainmentService implements INetworkDispatch {
|
||||
public void run() {
|
||||
if (spectator.getPosition().getDistance2D(performer.getWorldPosition()) > (float) 70) {
|
||||
|
||||
String pType = (performer.getPerformanceType()) ? "dance" : "music";
|
||||
if(pType.equals("dance")) {
|
||||
if(((performer.getPerformanceType()) ? "dance" : "music").equals("dance")) {
|
||||
spectator.setPerformanceWatchee(null);
|
||||
spectator.sendSystemMessage("You stop watching " + performer.getCustomName() + " because " + performer.getCustomName()
|
||||
+ " is out of range.", (byte) 0);
|
||||
@@ -452,6 +451,36 @@ public class EntertainmentService implements INetworkDispatch {
|
||||
spectator.setSpectatorTask(spectatorTask);
|
||||
}
|
||||
|
||||
public void performFlourish(final CreatureObject performer, int flourish) {
|
||||
|
||||
if (performer.getFlourishCount() > 0) {
|
||||
performer.sendSystemMessage("@performance:wait_flourish_self", (byte) 0);
|
||||
return;
|
||||
}
|
||||
Performance performance = getPerformanceByIndex(performer.getPerformanceId());
|
||||
|
||||
if(performance == null)
|
||||
return;
|
||||
|
||||
String anmFlo = "skill_action_" + flourish;
|
||||
|
||||
if (flourish == 9)
|
||||
anmFlo = "mistake";
|
||||
|
||||
performer.setFlourishCount(1);
|
||||
performer.sendSystemMessage("@performance:flourish_perform", (byte) 0);
|
||||
performer.doSkillAnimation(anmFlo);
|
||||
|
||||
scheduler.schedule(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
performer.setFlourishCount(0);
|
||||
}
|
||||
|
||||
}, (long) performance.getLoopDuration(), TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user