commit df7ab03fbfaa56ff5b4a44fc23ea9ca65b14cbcf Author: thefamilygrog Date: Thu Sep 26 21:59:42 2013 -0400 Initial upload diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..412eeda --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b9d6bd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,215 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +############# +## Windows detritus +############# + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac crap +.DS_Store + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist/ +build/ +eggs/ +parts/ +var/ +sdist/ +develop-eggs/ +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg diff --git a/README b/README new file mode 100644 index 0000000..c0caf6e --- /dev/null +++ b/README @@ -0,0 +1,26 @@ +Magic Beans (magicbeans) mod for Minetest + +by thefamilygrog66 + +Description: This mod randomly spawns three different types of magic beans - running, jumping and flying - which when eaten, give the player that magical ability for 30 seconds. Because of the inherent danger of temporarily flying, jumping really high or runnng really fast, it's highly recommended that this mod is only used with 'enable damage' unchecked! + +Note: The default textures are 64px - if you prefer 16px, they're included as well. Simply change the texture file names (e.g. magicbeans_jumping.png --> magicbeans_jumping64.png, magicbeans_jumping16.png --> magicbeans_jumping.png, etc.) accordingly. + +Mod dependencies: default + +License: Sourcecode: WTFPL (see below) Graphics: WTFPL (see below) + +Thank you very much Simonster for the cool mod idea and your constant inspiration! + +------------------------------------------------------------------------ + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 +Copyright (C) 2004 Sam Hocevar sam@hocevar.net + +Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +You just DO WHAT THE FUCK YOU WANT TO. diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..da7e3ca --- /dev/null +++ b/init.lua @@ -0,0 +1,54 @@ +magicbeans_list = { + { "Magic Jumping Beans", "jumping", 1, 5, 1}, + { "Magic Flying Beans", "flying", 2, 1, 0.02}, + { "Magic Running Beans", "running", 3, 1, 1}, +} + +for i in ipairs(magicbeans_list) do + + local beandesc = magicbeans_list[i][1] + local bean = magicbeans_list[i][2] + local beanspeed = magicbeans_list[i][3] + local beanjump = magicbeans_list[i][4] + local beangrav = magicbeans_list[i][5] + + --Item Registering + minetest.register_craftitem("magicbeans:"..bean, { + description = beandesc, + inventory_image = "magicbeans_"..bean..".png", + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.above then + minetest.env:add_item(pointed_thing.above, {name="magicbeans:"..bean}) + itemstack:take_item() + end + return itemstack + end, + on_use = function(itemstack, user, pointed_thing) + user:set_physics_override(beanspeed, beanjump, beangrav) + minetest.chat_send_player(user:get_player_name(),"Whoa, that was a strong magic "..bean.." bean!") + local normjump = function() + user:set_physics_override(1, 1, 1) + minetest.chat_send_player(user:get_player_name(),"Looks like you're back to normal now - no more crazy "..bean.."!") + end + minetest.after(30, normjump) + itemstack:take_item() + return itemstack + end, + }) + +end + +-- Bean Spawning +minetest.register_abm( + {nodenames = {"default:dirt_with_grass"}, + interval = 600, + chance = 3000, + action = function(pos) + pos.y = pos.y + 1 + math.randomseed(os.time()) + local j = math.random(3) + local bean = magicbeans_list[j][2] + minetest.env:add_item(pos, {name="magicbeans:"..bean}) + end, +}) + diff --git a/textures/magicbeans_flying.png b/textures/magicbeans_flying.png new file mode 100644 index 0000000..ca1406e Binary files /dev/null and b/textures/magicbeans_flying.png differ diff --git a/textures/magicbeans_flying16.png b/textures/magicbeans_flying16.png new file mode 100644 index 0000000..659dd0f Binary files /dev/null and b/textures/magicbeans_flying16.png differ diff --git a/textures/magicbeans_jumping.png b/textures/magicbeans_jumping.png new file mode 100644 index 0000000..e650238 Binary files /dev/null and b/textures/magicbeans_jumping.png differ diff --git a/textures/magicbeans_jumping16.png b/textures/magicbeans_jumping16.png new file mode 100644 index 0000000..b56edd7 Binary files /dev/null and b/textures/magicbeans_jumping16.png differ diff --git a/textures/magicbeans_running.png b/textures/magicbeans_running.png new file mode 100644 index 0000000..ad56ee4 Binary files /dev/null and b/textures/magicbeans_running.png differ diff --git a/textures/magicbeans_running16.png b/textures/magicbeans_running16.png new file mode 100644 index 0000000..b2ea3e5 Binary files /dev/null and b/textures/magicbeans_running16.png differ