Skip to content

Commit

Permalink
Merge pull request #435 from rcythr/mr_clean
Browse files Browse the repository at this point in the history
Mr clean
  • Loading branch information
Kyle Craviotto committed Oct 5, 2012
2 parents 4638e45 + c258d0b commit ed2e957
Show file tree
Hide file tree
Showing 120 changed files with 1,568 additions and 845 deletions.
1 change: 0 additions & 1 deletion data/scripts/__init__.py
@@ -1 +0,0 @@
print('init.py called')
Binary file removed data/scripts/__init__.pyc
Binary file not shown.
18 changes: 9 additions & 9 deletions data/scripts/commands/addfriend.py
Expand Up @@ -4,21 +4,21 @@
from swgpy.command import BaseSwgCommand

class AddFriendCommand(BaseSwgCommand):
def Run(self):
split = re.split('\W+', self.GetCommandString())
def run(self):
split = re.split('\W+', self.getCommandString())
friend_request_name = split[0]

actor = self.GetActor()
player = self.GetKernel().service_manager().equipment_service().GetPlayerObject(actor)
actor = self.getActor()
player = self.getKernel().serviceManager().equipmentService().getPlayerObject(actor)
if player:
# Check if the name is already in our friends list
if not player.is_friend(friend_request_name):
added = self.GetKernel().service_manager().social_service().add_friend(player, friend_request_name)
if not player.isFriend(friend_request_name):
added = self.getKernel().serviceManager().socialService().addFriend(player, friend_request_name)
if added:
actor.SendSystemMessage(swgpy.OutOfBand('cmnty', 'friend_added', swgpy.ProseType.TT, friend_request_name), False, False)
actor.sendSystemMessage(swgpy.outOfBand('cmnty', 'friend_added', swgpy.ProseType.TT, friend_request_name), False, False)
else:
actor.SendSystemMessage(swgpy.OutOfBand('cmnty', 'friend_not_found', swgpy.ProseType.TT, friend_request_name), False, False)
actor.sendSystemMessage(swgpy.outOfBand('cmnty', 'friend_not_found', swgpy.ProseType.TT, friend_request_name), False, False)
else:
actor.SendSystemMessage(swgpy.OutOfBand('cmnty', 'friend_duplicate', swgpy.ProseType.TT, friend_request_name), False, False)
actor.sendSystemMessage(swgpy.outOfBand('cmnty', 'friend_duplicate', swgpy.ProseType.TT, friend_request_name), False, False)
else:
print('Player object not found for object id' + actor.id)
16 changes: 8 additions & 8 deletions data/scripts/commands/addignore.py
Expand Up @@ -3,21 +3,21 @@
from swgpy.command import BaseSwgCommand

class AddIgnoreCommand(BaseSwgCommand):
def Run(self):
def run(self):
split = re.split('\W+', self.GetCommandString())
player_name = split[0]

actor = self.GetActor()
player = self.GetKernel().service_manager().equipment_service().GetPlayerObject(actor)
actor = self.getActor()
player = self.getKernel().serviceManager().equipmentService().getPlayerObject(actor)
if player:
# Check if the name is already in our friends list
if not player.is_ignored(player_name):
added = self.GetKernel().service_manager().social_service().add_ignore(player, player_name)
if not player.isIgnored(player_name):
added = self.getKernel().serviceManager().socialService().addIgnore(player, player_name)
if added:
actor.SendSystemMessage(swgpy.OutOfBand('cmnty', 'ignore_added', swgpy.ProseType.TT, player_name), False, False)
actor.SendSystemMessage(swgpy.outOfBand('cmnty', 'ignore_added', swgpy.ProseType.TT, player_name), False, False)
else:
actor.SendSystemMessage(swgpy.OutOfBand('cmnty', 'ignore_not_found', swgpy.ProseType.TT, player_name), False, False)
actor.SendSystemMessage(swgpy.outOfBand('cmnty', 'ignore_not_found', swgpy.ProseType.TT, player_name), False, False)
else:
actor.SendSystemMessage(swgpy.OutOfBand('cmnty', 'ignore_duplicate', swgpy.ProseType.TT, player_name), False, False)
actor.SendSystemMessage(swgpy.outOfBand('cmnty', 'ignore_duplicate', swgpy.ProseType.TT, player_name), False, False)
else:
print('Player object not found for object id' + actor.id)
44 changes: 22 additions & 22 deletions data/scripts/commands/burstrun.py
Expand Up @@ -5,53 +5,53 @@ class BurstRunCommand(BaseSwgCommand):
base_run_duration_ms = 15000
base_cooldate_timer_ms = 60000

def Validate(self):
actor = self.GetActor()
def validate(self):
actor = self.getActor()

if actor == None:
return False

if actor.HasFlag("BurstRunning"):
actor.SendSystemMessage('combat_effects', 'burst_run_no')
if actor.hasFlag("BurstRunning"):
actor.sendSystemMessage('combat_effects', 'burst_run_no')
return False

if actor.HasFlag("BurstRunCooldown"):
actor.SendSystemMessage('combat_effects', 'burst_run_wait')
if actor.hasFlag("BurstRunCooldown"):
actor.sendSystemMessage('combat_effects', 'burst_run_wait')
return False

# @TODO Check for mounts and whether or not in a space station/vehicle

return True

def Run(self):
actor = self.GetActor()
def run(self):
actor = self.getActor()

actor.SetFlag("BurstRunning")
actor.SetFlag("BurstRunCooldown")
actor.setFlag("BurstRunning")
actor.setFlag("BurstRunCooldown")

# increase the actor's run speed
actor.run_speed *= self.base_run_multiplier

actor.SendSystemMessage('cbt_spam', 'burstrun_start_single')
actor.sendSystemMessage('cbt_spam', 'burstrun_start_single')

return Callback(self.EndBurstRun, self.base_run_duration_ms)
return Callback(self.endBurstRun, self.base_run_duration_ms)

def EndBurstRun(self):
actor = self.GetActor()
def endBurstRun(self):
actor = self.getActor()

actor.RemoveFlag("BurstRunning")
actor.removeFlag("BurstRunning")

# decrease the actor's run speed by the increased amount
actor.run_speed /= self.base_run_multiplier

actor.SendSystemMessage('cbt_spam', 'burstrun_stop_single')
actor.SendSystemMessage('combat_effects', 'burst_run_tired')
actor.sendSystemMessage('cbt_spam', 'burstrun_stop_single')
actor.sendSystemMessage('combat_effects', 'burst_run_tired')

return Callback(self.EndBurstRunCooldown, self.base_cooldate_timer_ms - self.base_run_duration_ms)
return Callback(self.endBurstRunCooldown, self.base_cooldate_timer_ms - self.base_run_duration_ms)

def EndBurstRunCooldown(self):
actor = self.GetActor()
def endBurstRunCooldown(self):
actor = self.getActor()

actor.RemoveFlag("BurstRunCooldown")
actor.removeFlag("BurstRunCooldown")

actor.SendSystemMessage('combat_effects', 'burst_run_not_tired')
actor.sendSystemMessage('combat_effects', 'burst_run_not_tired')
14 changes: 7 additions & 7 deletions data/scripts/commands/deathblow.py
Expand Up @@ -2,12 +2,12 @@
from swgpy import POSTURE

class DeathBlowCommand(BaseSwgCommand):
def Run(self):
target = self.GetTarget()
def run(self):
target = self.getTarget()
if target:
if target.is_incap():
if target.isIncap():
target.posture = POSTURE.DEAD
target.clear_auto_attack()
actor.target_id = 0
actor.remove_duel_list(target.id)
target.remove_duel_list(actor.id)
target.clearAutoAttack()
actor.targetId = 0
actor.removeDuelList(target.id)
target.removeDuelList(actor.id)
24 changes: 12 additions & 12 deletions data/scripts/commands/duel.py
Expand Up @@ -2,20 +2,20 @@
from swgpy import PVPSTATUS, OutOfBand, ProseType

class DuelCommand(BaseSwgCommand):
def Run(self):
actor = self.GetActor()
target = self.GetTarget()
def run(self):
actor = self.getActor()
target = self.getTarget()

if not actor.in_duel_list(target.id):
actor.add_duel_list(target.id)
if not actor.inDuelList(target.id):
actor.addDuelList(target.id)
#system message
actor.SendSystemMessage(OutOfBand("duel", "challenge_self", ProseType.TT, target.id), False, False)
target.SendSystemMessage(OutOfBand("duel", "challenge_target", ProseType.TT, actor.id), False, False)
if actor.in_duel_list(target.id) and target.in_duel_list(actor.id):
actor.sendSystemMessage(outOfBand("duel", "challenge_self", ProseType.TT, target.id), False, False)
target.sendSystemMessage(outOfBand("duel", "challenge_target", ProseType.TT, actor.id), False, False)
if actor.inDuelList(target.id) and target.inDuelList(actor.id):
# Start The Duel
actor.SendSystemMessage(OutOfBand("duel", "accept_target", ProseType.TT, target.id), False, False)
target.SendSystemMessage(OutOfBand("duel", "accept_self", ProseType.TT, actor.id), False, False)
actor.sendSystemMessage(outOfBand("duel", "accept_target", ProseType.TT, target.id), False, False)
target.sendSystemMessage(outOfBand("duel", "accept_self", ProseType.TT, actor.id), False, False)
actor.pvp_status = PVPSTATUS.PvPStatus_Attackable
target.pvp_status = PVPSTATUS.PvPStatus_Attackable
actor.activate_auto_attack();
target.activate_auto_attack();
actor.activateAutoAttack();
target.activateAutoAttack();
12 changes: 6 additions & 6 deletions data/scripts/commands/endduel.py
@@ -1,12 +1,12 @@
from swgpy.command import BaseSwgCommand
from swgpy import combat
class EndDuelCommand(BaseSwgCommand):
def Run(self):
actor = self.GetActor()
target = self.GetTargetCreature()
def run(self):
actor = self.getActor()
target = self.getTargetCreature()

service_mgr = self.GetKernel().service_manager()
service_mgr = self.getKernel().serviceManager()

combat_svc = service_mgr.combat_service()
combat_svc = service_mgr.combatService()
if (actor and target):
combat_svc.end_duel(actor, target)
combat_svc.endDuel(actor, target)
6 changes: 3 additions & 3 deletions data/scripts/commands/kneel.py
Expand Up @@ -2,8 +2,8 @@
from swgpy import POSTURE

class KneelCommand(BaseSwgCommand):
def Run(self):
actor = self.GetActor()
def run(self):
actor = self.getActor()

actor.posture = POSTURE.CROUCHED
actor.run_speed = 0
actor.runSpeed = 0
24 changes: 12 additions & 12 deletions data/scripts/commands/peace.py
Expand Up @@ -2,19 +2,19 @@
from swgpy import ACTION

class PeaceCommand(BaseSwgCommand):
def Run(self):
actor = self.GetActor()
target = self.GetTarget()
def run(self):
actor = self.getActor()
target = self.getTarget()

if actor.has_state(ACTION.COMBAT):
actor.toggle_state_off(ACTION.COMBAT)
actor.toggle_state_on(ACTION.PEACE)
actor.remove_defender(target.id)
actor.target_id = 0
actor.clear_auto_attack()
if not target.has_state(ACTION.COMBAT):
target.remove_defender(actor.id)
if actor.hasState(ACTION.COMBAT):
actor.toggleStateOff(ACTION.COMBAT)
actor.toggleStateOn(ACTION.PEACE)
actor.removeDefender(target.id)
actor.targetId = 0
actor.clearAutoAttack()
if not target.hasState(ACTION.COMBAT):
target.removeDefender(actor.id)
#Send VIA ShowFlyText
#actor.Controller().SendSystemMessage("@combat_effects:go_peace")
else:
actor.state_bitmask = ACTION.NONE
actor.stateBitmask = ACTION.NONE
4 changes: 2 additions & 2 deletions data/scripts/commands/prone.py
Expand Up @@ -2,8 +2,8 @@
from swgpy import POSTURE

class ProneCommand(BaseSwgCommand):
def Run(self):
actor = self.GetActor()
def run(self):
actor = self.getActor()

actor.posture = POSTURE.PRONE
actor.run_speed = 1.0
16 changes: 8 additions & 8 deletions data/scripts/commands/removefriend.py
Expand Up @@ -3,15 +3,15 @@
from swgpy.command import BaseSwgCommand

class RemoveFriendCommand(BaseSwgCommand):
def Run(self):
split = re.split('\W+', self.GetCommandString())
def run(self):
split = re.split('\W+', self.getCommandString())
friend_name = split[0]
actor = self.GetActor()
player = actor.get_player()
actor = self.getActor()
player = actor.getPlayer()
if player:
# Check if the name is already our friend
if player.is_friend(friend_name):
player.remove_friend(friend_name)
actor.SendSystemMessage(swgpy.OutOfBand('cmnty', 'friend_removed', swgpy.ProseType.TT, friend_name), False, False)
if player.isFriend(friend_name):
player.removeFriend(friend_name)
actor.sendSystemMessage(swgpy.outOfBand('cmnty', 'friend_removed', swgpy.ProseType.TT, friend_name), False, False)
else:
actor.SendSystemMessage(swgpy.OutOfBand('cmnty', 'friend_not_found', swgpy.ProseType.TT, friend_name), False, False)
actor.sendSystemMessage(swgpy.outOfBand('cmnty', 'friend_not_found', swgpy.ProseType.TT, friend_name), False, False)
16 changes: 8 additions & 8 deletions data/scripts/commands/removeignore.py
Expand Up @@ -2,17 +2,17 @@
from swgpy.command import BaseSwgCommand

class SitServerCommand(BaseSwgCommand):
def Run(self):
split = re.split('\W+', self.GetCommandString())
def run(self):
split = re.split('\W+', self.getCommandString())
player_name = split[0]

actor = self.GetActor()
player = actor.get_player()
actor = self.getActor()
player = actor.getPlayer()

if player:
# Check if the name is in our ignore list
if player.is_ignored(player_name):
player.remove_ignore(player_name)
actor.SendSystemMessage(swgpy.OutOfBand('cmnty', 'ignore_removed', swgpy.ProseType.TT, player_name), False, False)
if player.isIgnored(player_name):
player.removeIgnore(player_name)
actor.sendSystemMessage(swgpy.outOfBand('cmnty', 'ignore_removed', swgpy.ProseType.TT, player_name), False, False)
else:
actor.SendSystemMessage(swgpy.OutOfBand('cmnty', 'ignore_not_found', swgpy.ProseType.TT, player_name), False, False)
actor.sendSystemMessage(swgpy.outOfBand('cmnty', 'ignore_not_found', swgpy.ProseType.TT, player_name), False, False)
30 changes: 14 additions & 16 deletions data/scripts/commands/setmoodinternal.py
@@ -1,29 +1,27 @@
from swgpy.command import BaseSwgCommand

class SetMoodInternalCommand(BaseSwgCommand):
def Run(self):
animation1 = ['3', '43', '55', '66', '169', '145', '50', '129', '161', '151', '179'] #Happy
animation2 = ['4', '147', '137', '168', '63', '155', '184', '148', '166', '170'] #Angry
animation3 = ['88', '163', '141', '120', '150', '35', '28', '138', '31', '149', '154', 'sad', '95', '158'] #Sad
animation4 = ['33', '49',] #disgruntled
animation5 = ['159', '126', '167', '132'] #worried
animation6 = ['0', '153'] #none
def run(self):
animation1 = [3, 43, 55, 66, 169, 145, 50, 129, 161, 151, 179] #Happy
animation2 = [4, 147, 137, 168, 63, 155, 184, 148, 166, 170] #Angry
animation3 = [88, 163, 141, 120, 150, 35, 28, 138, 31, 149, 154, 95, 158] #Sad
animation4 = [33, 49,] #disgruntled
animation5 = [159, 126, 167, 132] #worried
animation6 = [0, 153] #none



actor = self.GetActor()
mood = int(self.GetCommandString())
actor = self.getActor()
mood = int(self.getCommandString())
actor.mood_id = mood

if str(mood) in animation1:
if mood in animation1:
actor.mood_animation = "happy"
elif str(mood) in animation2:
elif mood in animation2:
actor.mood_animation = "angry"
elif str(mood) in animation3:
elif mood in animation3:
actor.mood_animation = "sad"
elif str(mood) in animation4:
elif mood in animation4:
actor.mood_animation = "disgruntled"
elif str(mood) in animation5:
elif mood in animation5:
actor.mood_animation = "worried"
else:
actor.mood_animation = "neutral"
Expand Down
4 changes: 2 additions & 2 deletions data/scripts/commands/sitserver.py
Expand Up @@ -2,8 +2,8 @@
from swgpy import POSTURE

class SitServerCommand(BaseSwgCommand):
def Run(self):
actor = self.GetActor()
def run(self):
actor = self.getActor()

actor.posture = POSTURE.SITTING
actor.run_speed = 0
7 changes: 4 additions & 3 deletions data/scripts/commands/stand.py
Expand Up @@ -4,8 +4,9 @@
class StandCommand(BaseSwgCommand):
base_run_speed = 5.75

def Run(self):
actor = self.GetActor()

def run(self):
print("test")
actor = self.getActor()
print("test")
actor.posture = POSTURE.UPRIGHT
actor.run_speed = self.base_run_speed

0 comments on commit ed2e957

Please sign in to comment.