From 47243fccfec416a5b56b66ffabfa0aa9eeff2cbf Mon Sep 17 00:00:00 2001 From: "A. Demant" Date: Tue, 11 Dec 2018 06:22:38 +0100 Subject: [PATCH] add swimmer awards --- abm.lua | 26 + awards.lua | 13 + config.lua | 37 + textures/src/AbstractSwimmer.svg | 4069 ++++++++++++++++++++++++ textures/statistic_awards_swimming.png | Bin 0 -> 1503 bytes 5 files changed, 4145 insertions(+) create mode 100644 textures/src/AbstractSwimmer.svg create mode 100644 textures/statistic_awards_swimming.png 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 0000000000000000000000000000000000000000..2e7d3f1914c303f098603ec1d75a517055ea4caf GIT binary patch literal 1503 zcmV<51t9u~P)v=&wKXO zhW6Hu@6eCGrEp?VI7d1q5)BLu2L&4z4<#K3*r6Qjx=r@XbMwPy@3&9%*Om6!oz1az zu#Y>XelC`II-!wh^2llEo-OIDN70rr%a=E-kyEmmU$2;FIb8WmbdC?p;fCnFd;FCgi&TE~bic5GYBv3={kZagX;IUNxh33HaDj>>GKHXSL?!`}E9~-G9AfhZFizgph92LDvK50}X z^1)r~tv7yKBQ+Hg(@H?)K{VntFvmYL-bXmov1R$vh1Y!!W+4~lLOW3$7N9yWN+BBJ zz-8>OQR9>@-ggj$PY{Kj#v%?3l`tmbH7bfdJRu7SWLiYcq*%#(S8ZG|uyr699Vi?x zP2VFJ*hfJl6&FxOF?C)kK{pr}93DA6MnzF%vCs35p}z+W4>2@0EiyhrH%HNMckNP0 z^KWRVJu?st5u%`y?ahD3xRV?pB6NL<93(BR$M9BTe4ew{xYF>Wz~>SkHxe5!jWH>? zC?%LwO%N9*ZG4@wilydjX69p8)oN-N4ir99f6>aR@y1}=yl-oe)=y}TaE7d#y78^f z_p!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