Difference between revisions of "User talk:Lisselli"

Jump to navigation Jump to search
1,136 bytes removed ,  04:12, 16 July 2017
m
no edit summary
imported>Lisselli
imported>Lisselli
m
Line 52: Line 52:
</source>
</source>
<source lang="papyrus">
<source lang="papyrus">
Float Function HasCellReset(Bool abSetDayLastEntered=True)
Float Function GetDaysInMonth(Float afMonth=0.0) Global
; RETURN VALUES: -1.0 = False | 100.0 = True
; Returns number of days of a month
; Morning Star ; 0 ; days 31 :: Sun's Height ; 6 ; days 31 
; Sun's Dawn  ; 1 ; days 28 :: Last Seed    ; 7 ; days 31
; First Seed  ; 2 ; days 31 :: Hearthfire  ; 8 ; days 30
; Rain's Hand  ; 3 ; days 30 :: Frostfall    ; 9 ; days 31
; Second Seed  ; 4 ; days 31 :: Sun's dusk  ; 10 ; days 30
; Midyear      ; 5 ; days 30 :: Evening Star ; 11 ; days 31
; Store the current month and day this function was called.
MonthEntered = GameMonth.GetValue()
DayEntered = GameDay.GetValue()


    ; Store RespawnTime game setting and convert it into days by dividing the result by 24.
; Morning Star ; 0.0 ; days 31.0 :: Sun's Height ; 6.0 ; days 31.
Float GetHoursToRespawnCell = Game.GetGameSettingInt("iHoursToRespawnCell") / 24 as Float
; Sun's Dawn  ; 1.0 ; days 28.0 :: Last Seed    ; 7.0 ; days 31.0
; First Seed  ; 2.0 ; days 31.0 :: Hearthfire  ; 8.0 ; days 30.0
      if abSetDayLastEntered == False
; Rain's Hand  ; 3.0 ; days 30.0 :: Frostfall    ; 9.0 ; days 31.0
; Second Seed  ; 4.0 ; days 31.0 :: Sun's dusk  ; 10.0 ; days 30.0
; Midyear      ; 5.0 ; days 30.0 :: Evening Star ; 11.0 ; days 31.0
 
if MonthEntered == 7
if afMonth == 0.0
iMonthNumDays = 31
return 31.0
Float CurrentMonth = GameMonth.GetValue()
elseif afMonth == 1.0
Float CurrentDay = GameDay.GetValue()
return 28.0
if MonthEntered == CurrentMonth
elseif afMonth == 2.0
if DayEntered < CurrentDay
return 31.0
; return days remaining
elseif afMonth == 3.0
Float DaysRemaining = CurrentDay - DayEntered
return 30.0
if DaysRemaining < GetHoursToRespawnCell
elseif afMonth == 4.0
; return days left for cell to respawn
return 31.0
return GetHoursToRespawnCell - DaysRemaining
elseif afMonth == 5.0
elseif DaysRemaining >= GetHoursToRespawnCell
return 30.0
; cell has respawned
elseif afMonth == 6.0
return DaysRemaining - GetHoursToRespawnCell
return 31.0
endif
elseif afMonth == 7.0
endif
return 31.0
else
elseif afMonth == 8.0
; it's a different month, so of course it's reset long time ago
return 30.0
return 100.0
elseif afMonth == 9.0
endif
return 31.0
endif
elseif afMonth == 10.0
endif
return 30.0
;/
elseif afMonth == 11.0
elseif MonthEntered == 1
return 31.0
iMonthNumDays = 28
endif
elseif MonthEntered == 2
EndFunction
iMonthNumDays = 31
elseif MonthEntered == 3
iMonthNumDays = 30
elseif MonthEntered == 4
iMonthNumDays = 31
elseif MonthEntered == 5
iMonthNumDays = 30
elseif MonthEntered == 6
iMonthNumDays = 31
elseif MonthEntered == 7
iMonthNumDays = 31
elseif MonthEntered == 8
iMonthNumDays = 30
elseif MonthEntered == 9
iMonthNumDays = 31
elseif MonthEntered == 10
iMonthNumDays = 30
elseif MonthEntered == 11
iMonthNumDays = 31
endif
/;
EndFunction
</source>
</source>
Anonymous user

Navigation menu