Skip to content

Commit

Permalink
Set sourceObj when building rumor list - simplifies GetRumor event
Browse files Browse the repository at this point in the history
  • Loading branch information
gcabbage committed Mar 24, 2018
1 parent 9638c61 commit 15b14fa
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 24 deletions.
1 change: 0 additions & 1 deletion TransCore/Abbasid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
{
attributes: "commonwealthPub"
priority: 22
sourceObj: gSource
textID: 'rumor.commonwealthPub
onExitRumor: (lambda (theRumor) (objSetKnown (@ theRumor 'sourceObj)))
}
Expand Down
2 changes: 0 additions & 2 deletions TransCore/BattleArena.xml
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,13 @@
{
attributes: 'commonwealthHabitat
priority: 100
sourceObj: gSource
textID: (cat "rumor.commonwealthHabitat.weapon"
(seededRandom (objGetDestiny (@ gData 'stationObj)) 1 5)
)
}
{
attributes: 'commonwealthHabitat
priority: 100
sourceObj: gSource
textID: (cat "rumor.commonwealthHabitat.shield"
(seededRandom (objGetDestiny (@ gData 'stationObj)) 1 3)
)
Expand Down
2 changes: 0 additions & 2 deletions TransCore/BlackMarket.xml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ PLAYER DATA
{
attributes: "commonwealthPub"
priority: 31
sourceObj: gSource
textID: 'rumor.commonwealthPub
onExitRumor: (lambda (theRumor) (objSetKnown (@ theRumor 'sourceObj)))
}
Expand Down Expand Up @@ -774,7 +773,6 @@ PLAYER DATA
{
attributes: "commonwealthPub"
priority: 23
sourceObj: gSource
textID: 'rumor.commonwealthPub
onExitRumor: (lambda (theRumor) (objSetKnown (@ theRumor 'sourceObj)))
}
Expand Down
1 change: 0 additions & 1 deletion TransCore/CentauriWarlords.xml
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@
{
attributes: "commonwealthPub"
priority: 10
sourceObj: gSource
textID: 'rumor.commonwealthPub
data: {station: (objGetName gSource)}
onExitRumor: (lambda (theRumor) (objSetKnown (@ theRumor 'sourceObj)))
Expand Down
1 change: 0 additions & 1 deletion TransCore/CorporateHierarchy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,6 @@
{
attributes: "commonwealthPub"
priority: 24
sourceObj: gSource
textID: 'rumor.commonwealthPub
data: {station: (objGetName gSource)}
onExitRumor: (lambda (theRumor) (objSetKnown (@ theRumor 'sourceObj)))
Expand Down
1 change: 0 additions & 1 deletion TransCore/DeathDrugsCartel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
{
attributes: "commonwealthPub"
priority: 40
sourceObj: gSource
textID: 'rumor.commonwealthPub
}
</GetRumors>
Expand Down
1 change: 0 additions & 1 deletion TransCore/KorolovShipping.xml
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,6 @@
{
attributes: "commonwealthPub"
priority: 21
sourceObj: gSource
textID: (switch
(or (not rank) (= rank 0)) 'rumor.commonwealthPub.norank
(ls rank 0) 'rumor.commonwealthPub.blacklisted
Expand Down
1 change: 0 additions & 1 deletion TransCore/Outlaws.xml
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@
{
attributes: "commonwealthPub"
priority: 11
sourceObj: gSource
textID: 'rumor.commonwealthPub
}
</GetRumors>
Expand Down
1 change: 0 additions & 1 deletion TransCore/Penitents.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
{
attributes: "commonwealthPub"
priority: 50
sourceObj: gSource
textID: 'rumor.commonwealthPub
}
</GetRumors>
Expand Down
23 changes: 14 additions & 9 deletions TransCore/RPGRumors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
{
attributes: attrib
priority: (or priority 10)
sourceObj: gSource
textID: (cat "rumor." attrib (if suf ".") suf)
data: data
onExitRumor: (switch
Expand Down Expand Up @@ -175,31 +174,37 @@
stationObj:gSource
})

; Lambda to add sourceType to global rumors
(wrapGlobalRumor (lambda (rumors theType)
; Lambda to set rumor defaults
(setRumorDefaults (lambda (default rumors)
(switch
(= (typeOf rumors) 'struct)
(set@ rumors { sourceObj:Nil sourceType:theType })
(struct default rumors)
(= (typeOf rumors) 'list)
(map rumors theRumor
(set@ theRumor { sourceObj:Nil sourceType:theType })
(struct default theRumor)
)
)
))

; Build rumor list from: global types, local stations, and missions
(allRumors (apply append (append
(map (typFind "*") 'excludeNil theType
(wrapGlobalRumor
(setRumorDefaults
{ sourceType: theType }
(typFireEvent theType 'GetGlobalRumors eventData)
theType
)
)
(map (sysFindObject Nil "AT") 'excludeNil theObj
(objFireEvent theObj 'GetRumors eventData)
(setRumorDefaults
{ sourceObj: theObj }
(objFireEvent theObj 'GetRumors eventData)
)
)
(map (msnFind "*") 'excludeNil msnObj
(msnFireEvent msnObj 'GetRumors eventData)
(setRumorDefaults
{ sourceObj: msnObj }
(msnFireEvent msnObj 'GetRumors eventData)
)
)
)))

Expand Down
1 change: 0 additions & 1 deletion TransCore/RaisuStation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@
{
attributes: 'commonwealthHabitat
priority: 10000
sourceObj: gSource
dialogID: 'descMeetingHallHappy
}
)
Expand Down
1 change: 0 additions & 1 deletion TransCore/Sapiens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
{
attributes: "commonwealthPub"
priority: 30
sourceObj: gSource
textID: 'rumor.commonwealthPub
onExitRumor: (lambda (theRumor) (objSetKnown (@ theRumor 'sourceObj)))
}
Expand Down
1 change: 0 additions & 1 deletion TransCore/SungSlavers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,6 @@
{
attributes: "commonwealthPub"
priority: 41
sourceObj: gSource
textID: 'rumor.commonwealthPub
}
</GetRumors>
Expand Down
1 change: 0 additions & 1 deletion TransCore/Xenophobes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,6 @@
{
attributes: "commonwealthPub"
priority: 60
sourceObj: gSource
textID: 'rumor.commonwealthPub
}
</GetRumors>
Expand Down

0 comments on commit 15b14fa

Please sign in to comment.