@@ -580,28 +580,39 @@ public void _handleCommunityGoalsEvent(CommunityGoalsEvent @event)
580580 {
581581 // Raise events for the notable changes in community goal status.
582582 var cgUpdates = new List < CGUpdate > ( ) ;
583- if ( mission . communalTier < goal . tier )
583+
584+ // Check for community goal tier changes
585+ if ( mission . communalTier < goal . tier )
584586 {
585- // Did the goal's current tier change?
586- cgUpdates . Add ( new CGUpdate ( "Tier" , "Increase" ) ) ;
587+ cgUpdates . Add ( new CGUpdate ( "Tier" , "Increase" ,
588+ mission . communalTier , goal . tier ) ) ;
587589 }
588- if ( goal . contribution > 0 )
590+
591+ // Check for player contribution changes
592+ if ( goal . contribution > mission . communalContribution )
589593 {
590- // Smaller percentile bands are better, larger percentile bands are worse
591- if ( mission . communalPercentileBand > goal . percentileband )
594+ cgUpdates . Add ( new CGUpdate ( "Contribution" , "Increase" ,
595+ mission . communalContribution , goal . contribution ) ) ;
596+ }
597+
598+ // Check for player percentile band changes
599+ if ( goal . contribution > 0 )
600+ {
601+ if ( mission . communalPercentileBand > goal . percentileband )
592602 {
593- // Did the player's percentile band increase (reach a smaller value)?
594- cgUpdates . Add ( new CGUpdate ( "Percentile" , "Increase" ) ) ;
603+ cgUpdates . Add ( new CGUpdate ( "Percentile" , "Increase" ,
604+ mission . communalPercentileBand , goal . percentileband ) ) ;
595605 }
596- if ( mission . communalPercentileBand < goal . percentileband )
606+ if ( mission . communalPercentileBand < goal . percentileband )
597607 {
598- // Did the player's percentile band decrease (reach a larger value)?
599- cgUpdates . Add ( new CGUpdate ( "Percentile" , "Decrease" ) ) ;
608+ cgUpdates . Add ( new CGUpdate ( "Percentile" , "Decrease" ,
609+ mission . communalPercentileBand , goal . percentileband ) ) ;
600610 }
601611 }
602- if ( cgUpdates . Any ( ) )
612+
613+ if ( cgUpdates . Any ( ) )
603614 {
604- EDDI . Instance . enqueueEvent ( new CommunityGoalEvent ( DateTime . UtcNow , cgUpdates , goal ) ) ;
615+ EDDI . Instance . enqueueEvent ( new CommunityGoalEvent ( DateTime . UtcNow , cgUpdates , goal ) ) ;
605616 }
606617
607618 // Update our mission records
@@ -614,16 +625,18 @@ public void _handleCommunityGoalsEvent(CommunityGoalsEvent @event)
614625 mission . communal = true ;
615626 mission . communalPercentileBand = goal . percentileband ;
616627 mission . communalTier = goal . tier ;
628+ mission . communalContribution = goal . contribution ;
617629 mission . expiry = goal . expiryDateTime ;
618- if ( goal . iscomplete )
630+
631+ if ( goal . iscomplete )
619632 {
620- if ( goal . contribution > 0 )
633+ if ( goal . contribution > 0 )
621634 {
622635 mission . statusDef = MissionStatus . Claim ;
623636 }
624637 else
625638 {
626- RemoveMissionWithMissionId ( mission . missionid ) ;
639+ RemoveMissionWithMissionId ( mission . missionid ) ;
627640 }
628641 }
629642 }
0 commit comments