Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Party Command #82

Merged
merged 4 commits into from
Jun 2, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Python/ki/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4471,7 +4471,7 @@ def BigKIProcessContentList(self, removeInboxStuff=False):
if isinstance(content, ptVaultNodeRef):
element = content.getChild()
if element is not None:
if element.getType() == PtVaultNodeTypes.kFolderNode:
if element.getType() == PtVaultNodeTypes.kFolderNode or element.getType() == PtVaultNodeTypes.kChronicleNode:
removeList.insert(0, contentidx)
for removeidx in removeList:
del self.BKContentList[removeidx]
Expand Down
64 changes: 64 additions & 0 deletions Python/ki/xKIChat.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
from Plasma import *
from PlasmaConstants import *
from PlasmaKITypes import *
from PlasmaNetConstants import *
from PlasmaTypes import *
from PlasmaVaultConstants import *

Expand Down Expand Up @@ -1314,6 +1315,69 @@ def LookForFeathers(self, params):
# Other Commands #
##################

def PartyTime(self, params):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you put this right above the # Other Commands # area in the # Easter Egg Commands # one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OtherCommands was not available when I introduced this command

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, but they where when you opened the PR and I would not consider it an easter egg command. ;)

"""Implements the `/party` command"""

# First, find the PartyAge chronicle in the global inbox
party = None
vault = ptVault()
inbox = vault.getGlobalInbox()
for childRef in inbox.getChildNodeRefList():
child = childRef.getChild()
if not child:
continue
child = child.upcastToChronicleNode()
if not child:
continue
if child.chronicleGetName() == kChron.Party:
party = child
break

# Let's see what we need to do
if not params:
# No params = LINK ME!
if party and party.chronicleGetValue():
data = party.chronicleGetValue().split(";", 3)
ageInfo = ptAgeInfoStruct()
ageInfo.setAgeFilename(data[0])
ageInfo.setAgeInstanceGuid(data[1])

ageLink = ptAgeLinkStruct()
ageLink.setAgeInfo(ageInfo)
ageLink.setLinkingRules(PtLinkingRules.kBasicLink)
ageLink.setSpawnPoint(ptSpawnPointInfo(data[2], data[2]))

# Player is not really linking--this is an OOC cheat.
nlm = ptNetLinkingMgr()
nlm.linkToAge(ageLink, linkInSfx=False, linkOutSfx=False)
else:
self.chatMgr.AddChatLine(None, "There is no party to crash!", kChat.SystemMessage)
return
elif PtIsInternalRelease():
try:
PtFindSceneobject(params, PtGetAgeName())
except NameError:
# Garbage SO = kill party
if party:
party.chronicleSetValue("")
party.save()
self.chatMgr.AddChatLine(None, "Party Crashed.", 0)
else:
self.chatMgr.AddChatLine(None, "No party. Your link-in-point is invalid.", kChat.SystemMessage)
else:
# Got a LIP... Need to set the chronicle
ageInfo = PtGetAgeInfo()
data = "%s;%s;%s" % (ageInfo.getAgeFilename(), ageInfo.getAgeInstanceGuid(), params)
if not party:
party = ptVaultChronicleNode()
party.chronicleSetName(kChron.Party)
party.chronicleSetValue(data)
party.save() # creates node on server (and blocks) so we can add it to the global inbox
inbox.addNode(party)
else:
party.chronicleSetValue(data)
party.save()

## Export the local avatar's clothing to a file
def SaveClothing(self, file):
if not file:
Expand Down
4 changes: 3 additions & 1 deletion Python/ki/xKIConstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ class kChron:
BuddiesOnRequest = "PlayerKIBuddiesOnRequest"
BuddiesOnRequestType = 2
CGZPlaying = "CGZPlaying"
Party = "PartyAge"

## Color definitions.
class kColors:
Expand Down Expand Up @@ -251,7 +252,8 @@ class kCommands:
"/look in pocket" : "LookForFeathers"}
Text = {"/go" : "Put one foot in front of the other and eventually you will get there.",
"/fly" : "You close your eyes, you feel light headed and the ground slips away from your feet... Then you open your eyes and WAKE UP! (Ha, you can only dream about flying.)"}
Other = {"/saveclothing" : "SaveClothing",
Other = {"/party" : "PartyTime",
"/saveclothing" : "SaveClothing",
"/loadclothing" : "LoadClothing",
"/threaten" : "CoopExample"}

Expand Down