diff --git a/abm.lua b/abm.lua index 49fe85b..3121fde 100644 --- a/abm.lua +++ b/abm.lua @@ -37,6 +37,32 @@ minetest.register_globalstep(function(dtime) end end end + local player_swam=xpfw.player_get_attribute(player,"swam") + local swam_award=statistic_awards.swimming[1] + if player_swam ~= nil then + if player_swam > 0 then + local swim_i=1 + local bswim = true + local aw_def=statistic_awards.swimming[swim_i] + while bswim do + local aw_def=statistic_awards.swimming[swim_i] + if aw_def ~= nil then + if basic_functions.has_value(player_awards.unlocked,aw_def.basename..aw_def.level) == false then + bswim=false + swam_award=aw_def + end + else + bswim = false + end + swim_i=swim_i+1 + end + if aw_def ~= nil then + if aw_def.threshold 1 then + awdef.requires=aw_def.basename..(aw_def.level-1) + awdef.secret=true + end + awards.register_achievement(aw_def.basename..aw_def.level,awdef) + end for i,aw_def in ipairs(statistic_awards.deaths) do local awdef={ title=aw_def.titel, diff --git a/config.lua b/config.lua index f332762..f98ee54 100644 --- a/config.lua +++ b/config.lua @@ -35,6 +35,43 @@ statistic_awards.hiking={ threshold=500000, difficulty=1,}, } +statistic_awards.swimming={ + {basename="statisticawards_swimming", + level=1, + title="Swam 100 miles", + description="You swam quite far. Keep going.", + baseicon = "statistic_awards_swimming.png", + threshold=100, + difficulty=0.001,}, + {basename="statisticawards_swimming", + level=2, + title="Swam 1000 miles", + description="You swam quite far. Keep going.", + baseicon = "statistic_awards_swimming.png", + threshold=1000, + difficulty=0.005,}, + {basename="statisticawards_swimming", + level=3, + title="Swam 5000 miles", + description="You swam quite far. Keep going.", + baseicon = "statistic_awards_swimming.png", + threshold=5000, + difficulty=0.01,}, + {basename="statisticawards_swimming", + level=4, + title="Swam 10000 miles", + description="You swam quite far. Keep going.", + baseicon = "statistic_awards_swimming.png", + threshold=10000, + difficulty=0.1,}, + {basename="statisticawards_swimming", + level=5, + title="Swam 50000 miles", + description="You swam quite far. Keep going.", + baseicon = "statistic_awards_swimming.png", + threshold=50000, + difficulty=1,}, +} statistic_awards.deaths={ {basename="statisticawards_deaths", diff --git a/textures/src/AbstractSwimmer.svg b/textures/src/AbstractSwimmer.svg new file mode 100644 index 0000000..9df2ba2 --- /dev/null +++ b/textures/src/AbstractSwimmer.svg @@ -0,0 +1,4069 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/textures/statistic_awards_swimming.png b/textures/statistic_awards_swimming.png new file mode 100644 index 0000000..2e7d3f1 Binary files /dev/null and b/textures/statistic_awards_swimming.png differ