123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693 |
- --Stuff from vessels
- -- -
- -- Copyright (C) 2012 Vanessa Ezekowitz
- -- Copyright (C) 2012 celeron55, Perttu Ahola <celeron55@gmail.com>
- -- This program is free software: you can redistribute it and/or modify
- -- it under the terms of the GNU General Public License as published by
- -- the Free Software Foundation, either version 3 of the License, or
- -- at your option) any later version.
- -- This program is distributed in the hope that it will be useful,
- -- but WITHOUT ANY WARRANTY; without even the implied warranty of
- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- -- GNU General Public License for more details.
- -- You should have received a copy of the GNU General Public License
- -- along with this program. If not, see <http://www.gnu.org/licenses/>.
- --changes so that bottles can't stack
- minetest.override_item("vessels:glass_bottle", {
- stack_max = 3,
- })
- local vessels_shelf_formspec =
- "size[8,7;]"..
- default.gui_bg..
- default.gui_bg_img..
- default.gui_slots..
- "list[context;vessels;0,0.3;8,2;]"..
- "list[current_player;main;0,2.85;8,1;]"..
- "list[current_player;main;0,4.08;8,3;8]"..
- "listring[context;vessels]"..
- "listring[current_player;main]"..
- default.get_hotbar_bg(0,2.85)
- minetest.register_node("witchcraft:shelf", {
- description = "Potion shelf",
- tiles = {"default_wood.png", "default_wood.png", "default_wood.png^vessels_shelf.png^vessels_shelf_overlay.png"},
- is_ground_content = false,
- groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
- sounds = default.node_sound_wood_defaults(),
- on_construct = function(pos)
- local meta = minetest.get_meta(pos)
- meta:set_string("formspec", vessels_shelf_formspec)
- local inv = meta:get_inventory()
- inv:set_size("vessels", 8*2)
- end,
- can_dig = function(pos,player)
- local meta = minetest.get_meta(pos);
- local inv = meta:get_inventory()
- return inv:is_empty("vessels")
- end,
- allow_metadata_inventory_put = function(pos, listname, index, stack, player)
- local meta = minetest.get_meta(pos)
- local inv = meta:get_inventory()
- local to_stack = inv:get_stack(listname, index)
- if listname == "vessels" then
- if minetest.get_item_group(stack:get_name(), "potion") ~= 0
- or minetest.get_item_group(stack:get_name(), "potion2") ~= 0
- and to_stack:is_empty() then
- return 1
- end
- return 0
- end
- end,
- allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
- local meta = minetest.get_meta(pos)
- local inv = meta:get_inventory()
- local stack = inv:get_stack(from_list, from_index)
- local to_stack = inv:get_stack(to_list, to_index)
- if to_list == "vessels" then
- if minetest.get_item_group(stack:get_name(), "potion") ~= 0
- or minetest.get_item_group(stack:get_name(), "potion2") ~= 0
- and to_stack:is_empty() then
- return 1
- end
- return 0
- end
- end,
- on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
- minetest.log("action", player:get_player_name()..
- " moves stuff in vessels shelf at "..minetest.pos_to_string(pos))
- end,
- on_metadata_inventory_put = function(pos, listname, index, stack, player)
- minetest.log("action", player:get_player_name()..
- " puts stuff to vessels shelf at "..minetest.pos_to_string(pos))
- end,
- on_metadata_inventory_take = function(pos, listname, index, stack, player)
- minetest.log("action", player:get_player_name()..
- " takes stuff from vessels shelf at "..minetest.pos_to_string(pos))
- end,
- })
- --my stuff
- -- Copyright (C) 2016 DOOmed <heiselong@gmx.com>
- -- This program is free software; you can redistribute it and/or modify
- -- it under the terms of the GNU Lesser General Public License as published by
- -- the Free Software Foundation; either version 2.1 of the License, or
- -- (at your option) any later version.
- -- This program is distributed in the hope that it will be useful,
- -- but WITHOUT ANY WARRANTY; without even the implied warranty of
- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- -- GNU Lesser General Public License for more details.
- -- You should have received a copy of the GNU Lesser General Public License along
- -- with this program; if not, write to the Free Software Foundation, Inc.,
- -- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- --ingredients
- minetest.register_node("witchcraft:bottle_eyes", {
- description = "Jar of eyes",
- drawtype = "plantlike",
- tiles = {"witchcraft_jar_eyes.png"},
- inventory_image = "witchcraft_jar_eyes.png",
- wield_image = "witchcraft_jar_eyes.png",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- stack_max = 1,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- })
- minetest.register_node("witchcraft:bottle_slime", {
- description = "Jar of Slime",
- drawtype = "plantlike",
- tiles = {"witchcraft_jar_slime.png"},
- inventory_image = "witchcraft_jar_slime.png",
- wield_image = "witchcraft_jar_slime.png",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- stack_max = 1,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- })
- minetest.register_craftitem("witchcraft:herb", {
- description = "herb",
- inventory_image = "witchcraft_herbs.png"
- })
- minetest.register_craftitem("witchcraft:tooth", {
- description = "tooth",
- inventory_image = "witchcraft_tooth.png"
- })
- minetest.register_craftitem("witchcraft:horn", {
- description = "horn",
- inventory_image = "witchcraft_horn.png"
- })
- minetest.register_craftitem("witchcraft:bone", {
- description = "bone",
- inventory_image = "witchcraft_bone.png"
- })
- --crafting
- minetest.register_craft({
- output = 'witchcraft:shelf',
- recipe = {
- {'group:wood', 'group:wood', 'group:wood'},
- {'group:potion', 'group:potion', 'group:potion'},
- {'group:wood', 'group:wood', 'group:wood'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:bottle_eyes',
- recipe = {
- {'witchcraft:eye'},
- {'witchcraft:eye'},
- {'vessels:drinking_glass'},
- }
- })
- minetest.register_craft({
- output = "witchcraft:eye 2",
- type = "shapeless",
- recipe = {"witchcraft:bottle_eyes"}
- })
- minetest.register_craft({
- output = "witchcraft:herb 4",
- type = "shapeless",
- recipe = {"default:grass_5"}
- })
- minetest.register_craft({
- output = "witchcraft:herb 4",
- type = "shapeless",
- recipe = {"default:grass_4"}
- })
- minetest.register_craft({
- output = "witchcraft:herb 4",
- type = "shapeless",
- recipe = {"default:grass_3"}
- })
- minetest.register_craft({
- output = "witchcraft:herb 4",
- type = "shapeless",
- recipe = {"default:grass_2"}
- })
- minetest.register_craft({
- output = "witchcraft:herb 4",
- type = "shapeless",
- recipe = {"default:grass_1"}
- })
- minetest.register_craft({
- output = 'witchcraft:pot',
- recipe = {
- {'default:copper_lump', '', 'default:copper_lump'},
- {'default:copper_lump', '', 'default:copper_lump'},
- {'', 'default:copper_lump', ''},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:mortar',
- recipe = {
- {'default:stone', '', 'default:stone'},
- {'default:stone', '', 'default:stone'},
- {'', 'default:stone', ''},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:pentagram',
- recipe = {
- {'default:torch', 'default:clay', 'default:torch'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:small_bottle',
- recipe = {
- {'vessels:glass_fragments', 'vessels:glass_fragments', 'vessels:glass_fragments'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:bottle_medicine 2',
- recipe = {
- {'witchcraft:small_bottle', 'witchcraft:potion_red', 'witchcraft:small_bottle'},
- },
- replacements = {
- {"witchcraft:potion_red", "vessels:glass_bottle"}
- }
- })
- minetest.register_craft({
- output = 'witchcraft:mud_bottle',
- recipe = {
- {'default:dirt'},
- {'witchcraft:small_bottle'},
- },
- })
- minetest.register_craft({
- output = 'witchcraft:bone_bottle',
- recipe = {
- {'bones:bones'},
- {'witchcraft:small_bottle'},
- },
- })
- minetest.register_craft({
- output = 'witchcraft:herb_bottle',
- recipe = {
- {'witchcraft:herb'},
- {'witchcraft:small_bottle'},
- },
- })
- minetest.register_craft({
- output = 'witchcraft:slime_bottle',
- recipe = {
- {'witchcraft:bottle_slime'},
- {'witchcraft:small_bottle'},
- },
- replacements = {
- {"witchcraft:bottle_slime", "vessels:drinking_glass"}
- }
- })
- minetest.register_craft({
- output = 'witchcraft:herb',
- recipe = {
- {'witchcraft:herb_bottle'},
- },
- replacements = {
- {"witchcraft:herb_bottle", "witchcraft:small_bottle"}
- }
- })
- minetest.register_craft({
- output = 'bones:bones',
- recipe = {
- {'witchcraft:bone_bottle'},
- },
- replacements = {
- {"witchcraft:bone_bottle", "witchcraft:small_bottle"}
- }
- })
- minetest.register_craft({
- output = 'default:dirt',
- recipe = {
- {'witchcraft:mud_bottle'},
- },
- replacements = {
- {"witchcraft:mud_bottle", "witchcraft:small_bottle"}
- }
- })
- minetest.register_craft({
- output = 'witchcraft:bottle_slime',
- recipe = {
- {'witchcraft:slime_bottle'},
- },
- replacements = {
- {"witchcraft:slime_bottle", "witchcraft:small_bottle"}
- }
- })
- minetest.register_craft({
- output = 'witchcraft:slime_bottle',
- recipe = {
- {'witchcraft:bottle_slime'},
- {'witchcraft:small_bottle'},
- },
- })
- minetest.register_craft({
- output = 'vessels:glass_fragments 3',
- type = "shapeless",
- recipe = {"default:glass"}
- })
- minetest.register_craft({
- output = 'witchcraft:bone 4',
- recipe = {
- {'bones:bones', 'bones:bones'},
- },
- })
- --teeth from sand, maybe fossilised?
- minetest.register_craft({
- output = 'witchcraft:tooth 1',
- type = "shapeless",
- recipe = {"default:sand"}
- })
- --splash potions crafting
- minetest.register_craft({
- output = 'witchcraft:splash_yellwgrn',
- recipe = {
- {'vessels:glass_fragments'},
- {'witchcraft:potion_yllwgrn'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:splash_orange',
- recipe = {
- {'vessels:glass_fragments'},
- {'witchcraft:potion_orange'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:splash_purple',
- recipe = {
- {'vessels:glass_fragments'},
- {'witchcraft:potion_purple'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:splash_magenta',
- recipe = {
- {'vessels:glass_fragments'},
- {'witchcraft:potion_magenta'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:splash_cyan',
- recipe = {
- {'vessels:glass_fragments'},
- {'witchcraft:potion_cyan'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:splash_red',
- recipe = {
- {'vessels:glass_fragments'},
- {'witchcraft:potion_red'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:splash_green',
- recipe = {
- {'vessels:glass_fragments'},
- {'witchcraft:potion_green'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:splash_grey',
- recipe = {
- {'vessels:glass_fragments'},
- {'witchcraft:potion_grey'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:splash_brown',
- recipe = {
- {'vessels:glass_fragments'},
- {'witchcraft:potion_brown'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:splash_redbrown',
- recipe = {
- {'vessels:glass_fragments'},
- {'witchcraft:potion_redbrown'},
- }
- })
- minetest.register_craft({
- output = 'witchcraft:splash_ggreen',
- recipe = {
- {'vessels:glass_fragments'},
- {'witchcraft:potion_ggreen'},
- }
- })
- --empty cooking pot
- minetest.register_node("witchcraft:pot", {
- description = "magic cooking pot",
- tiles = {
- "witchcraft_pot_top.png",
- "witchcraft_pot_bottom.png",
- "witchcraft_pot_side.png",
- "witchcraft_pot_side.png",
- "witchcraft_pot_side.png",
- "witchcraft_pot_side.png"
- },
- drawtype = "nodebox",
- paramtype = "light",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, 0.4375}, -- NodeBox1
- {-0.375, -0.4375, -0.375, 0.375, -0.375, 0.375}, -- NodeBox2
- {-0.3125, -0.375, -0.3125, 0.3125, -0.3125, 0.3125}, -- NodeBox3
- {-0.375, -0.3125, -0.375, 0.375, -0.25, 0.375}, -- NodeBox4
- {-0.4375, -0.25, -0.4375, 0.4375, -0.1875, 0.4375}, -- NodeBox5
- {-0.5, -0.1875, -0.5, 0.5, -0.125, 0.5}, -- NodeBox7
- {-0.5, -0.125, -0.5, 0.5, 0.3125, -0.3125}, -- NodeBox8
- {-0.5, -0.125, 0.3125, 0.5, 0.3125, 0.5}, -- NodeBox9
- {0.3125, -0.1875, -0.5, 0.5, 0.3125, 0.5}, -- NodeBox10
- {-0.5, -0.125, -0.5, -0.3125, 0.3125, 0.5}, -- NodeBox11
- {-0.4375, 0.375, 0.3125, 0.4375, 0.5, 0.4375}, -- NodeBox12
- {-0.4375, 0.375, -0.4375, 0.4375, 0.5, -0.3125}, -- NodeBox13
- {-0.4375, 0.375, -0.4375, 0.4375, 0.5, -0.3125}, -- NodeBox14
- {0.3125, 0.375, -0.4375, 0.4375, 0.5, 0.4375}, -- NodeBox15
- {-0.4375, 0.375, -0.4375, -0.3125, 0.5, 0.4375}, -- NodeBox16
- {-0.375, 0.3125, -0.375, 0.375, 0.375, -0.3125}, -- NodeBox17
- {-0.375, 0.3125, 0.3125, 0.375, 0.375, 0.375}, -- NodeBox18
- {0.3125, 0.3125, -0.375, 0.375, 0.375, 0.375}, -- NodeBox19
- {-0.375, 0.3125, -0.375, -0.3125, 0.375, 0.375}, -- NodeBox20
- }
- },
- on_rightclick = function(pos, node, clicker, item, _)
- local wield_item = clicker:get_wielded_item():get_name()
- if wield_item == "bucket:bucket_water" or
- wield_item == "bucket:bucket_river_water" then
- minetest.set_node(pos, {name="witchcraft:pot_blue", param2=node.param2})
- item:replace("bucket:bucket_empty")
- elseif wield_item == "vessels:drinking_glass" then
- item:replace("witchcraft:bottle_slime")
- end
- end,
- groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1}
- })
- --level 1 potions from cooking pot
- local witchcraft = {}
- witchcraft.pot = {
- {"blue", "blue2", "flowers:waterlily", "brown", "default:dirt", "red", "purple"},
- {"blue2", "green", "default:papyrus", "", "", "gred", "magenta"},
- {"green", "green2", "default:sapling", "", "", "yellow", "yllwgrn"},
- {"green2", "yellow", "default:mese_crystal_fragment", "", "", "blue", "cyan"},
- {"yellow", "ggreen", "flowers:mushroom_brown", "", "", "green", "yllwgrn"},
- {"ggreen", "cyan", "witchcraft:slime_bottle", "", "", "gcyan", "aqua"},
- {"cyan", "gcyan", "witchcraft:bottle_medicine", "", "", "blue", "blue2"},
- {"gcyan", "orange", "default:torch", "", "", "ggreen", "aqua"},
- {"orange", "yllwgrn", "tnt:gunpowder", "", "", "red", "redbrown"},
- {"yllwgrn", "gold", "default:steel_ingot", "", "", "green", "green2"},
- {"gold", "aqua", "default:diamond", "", "", "", ""},
- {"aqua", "", "", "", "", "", ""},
- {"brown", "redbrown", "flowers:mushroom_red", "", "", "red", "redbrown"},
- {"redbrown", "gred", "default:apple", "", "", "", ""},
- {"gred", "red", "witchcraft:herbs", "", "", "blue2", "magenta"},
- {"red", "magenta", "witchcraft:tooth", "", "", "blue", "purple"},
- {"magenta", "gpurple", "witchcraft:bottle_slime", "", "", "cyan", "darkpurple"},
- {"gpurple", "purple", "witchcraft:bone_bottle", "", "", "yllwgrn", "green2"},
- {"purple", "darkpurple", "default:glass", "", "", "yellow", "green"},
- {"darkpurple", "silver", "default:steel_ingot", "", "", "", ""},
- {"silver", "grey", "witchcraft:bone", "", "", "", ""},
- {"grey", "aqua", "default:diamond", "", "", "", ""},
- }
- --potion pots
- for _, row in ipairs(witchcraft.pot) do
- local color = row[1]
- local newcolor = row[2]
- local newcolor2 = row[4]
- local ingredient = row[3]
- local ingredient2 = row[5]
- local combine = row[6]
- local cresult = row[7]
- minetest.register_node("witchcraft:pot_"..color, {
- tiles = {
- { name = "witchcraft_pot_"..color..".png",
- animation = {type="vertical_frames", length=3.0} },
- "witchcraft_pot_bottom.png",
- "witchcraft_pot_side.png",
- "witchcraft_pot_side.png",
- "witchcraft_pot_side.png",
- "witchcraft_pot_side.png"
- },
- drawtype = "nodebox",
- paramtype = "light",
- drop = {
- items = {
- {items = {'witchcraft:pot'}, rarity = 1},
- }
- },
- node_box = {
- type = "fixed",
- fixed = {
- {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, 0.4375}, -- NodeBox1
- {-0.375, -0.4375, -0.375, 0.375, -0.375, 0.375}, -- NodeBox2
- {-0.3125, -0.375, -0.3125, 0.3125, -0.3125, 0.3125}, -- NodeBox3
- {-0.375, -0.3125, -0.375, 0.375, 0.5, 0.375}, -- NodeBox4
- {-0.4375, -0.25, -0.4375, 0.4375, 0.3125, 0.4375}, -- NodeBox5
- {-0.5, -0.1875, -0.5, 0.5, 0.3125, 0.5}, -- NodeBox6
- {-0.4375, 0.375, -0.4375, 0.4375, 0.5, 0.4375}, -- NodeBox7
- }
- },
- on_rightclick = function(pos, node, clicker, item, _)
- local wield_item = clicker:get_wielded_item():get_name()
- if wield_item == "vessels:glass_bottle" then
- item:replace("witchcraft:potion_"..color)
- if clicker:get_wielded_item():get_count() == 3 then
- minetest.env:add_item({x=pos.x, y=pos.y+1.5, z=pos.z}, "witchcraft:potion_"..color)
- minetest.env:add_item({x=pos.x, y=pos.y+1.5, z=pos.z}, "witchcraft:potion_"..color)
- end
- minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2})
- elseif wield_item == ingredient then
- minetest.set_node(pos, {name="witchcraft:pot_"..newcolor, param2=node.param2})
- item:take_item()
- elseif wield_item == ingredient2 then
- minetest.set_node(pos, {name="witchcraft:pot_"..newcolor2, param2=node.param2})
- item:take_item()
- elseif wield_item == "bucket:bucket_water" then
- minetest.set_node(pos, {name="witchcraft:pot_blue", param2=node.param2})
- item:replace("bucket:bucket_empty")
- elseif wield_item == "witchcraft:potion_"..combine then
- minetest.set_node(pos, {name="witchcraft:pot_"..cresult, param2=node.param2})
- item:replace("vessels:glass_bottle")
- end
- end,
- groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1}
- })
- end
- --pot effects
- minetest.register_abm({
- nodenames = {"witchcraft:pot_water", "witchcraft:pot_gold", "witchcraft:pot_redbrown", "witchcraft:pot_blue2", "witchcraft:pot_cyan", "witchcraft:pot_green", "witchcraft:pot_green2", "witchcraft:pot_aqua", "witchcraft:pot_yellow", "witchcraft:pot_yllwgrn", "witchcraft:pot_red", "witchcraft:pot_magenta", "witchcraft:pot_brown"},
- interval = 0.5,
- chance = 1,
- action = function(pos, node)
- minetest.add_particlespawner({
- amount = 2,
- time = 1,
- minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1},
- maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1},
- minvel = {x=0, y=0.5, z=0},
- maxvel = {x=0, y=0.6, z=0},
- minacc = {x=0, y=0.2, z=0},
- maxacc = {x=0, y=0.3, z=0},
- minexptime = 1,
- maxexptime = 2,
- minsize = 2,
- maxsize = 3,
- collisiondetection = false,
- texture = "witchcraft_bubbles.png"
- })
- end
- })
- minetest.register_abm({
- nodenames = {"witchcraft:pot_ggreen", "witchcraft:pot_gred", "witchcraft:pot_gpurple", "witchcraft:pot_gcyan"},
- interval = 0.5,
- chance = 1,
- action = function(pos, node)
- minetest.add_particlespawner({
- amount = 2,
- time = 1,
- minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1},
- maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1},
- minvel = {x=0, y=0.5, z=0},
- maxvel = {x=0, y=0.6, z=0},
- minacc = {x=0, y=0.2, z=0},
- maxacc = {x=0, y=0.3, z=0},
- minexptime = 1,
- maxexptime = 2,
- minsize = 1,
- maxsize = 2,
- collisiondetection = false,
- texture = "witchcraft_light_over.png"
- })
- end
- })
- minetest.register_abm({
- nodenames = {"witchcraft:pot_purple"},
- interval = 0.5,
- chance = 1,
- action = function(pos, node)
- minetest.add_particlespawner({
- amount = 2,
- time = 1,
- minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1},
- maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1},
- minvel = {x=0, y=0.5, z=0},
- maxvel = {x=0, y=0.6, z=0},
- minacc = {x=0, y=0.2, z=0},
- maxacc = {x=0, y=0.3, z=0},
- minexptime = 1,
- maxexptime = 2,
- minsize = 5,
- maxsize = 8,
- collisiondetection = false,
- texture = "witchcraft_smoke.png"
- })
- end
- })
- minetest.register_abm({
- nodenames = {"witchcraft:pot_darkpurple"},
- interval = 0.5,
- chance = 1,
- action = function(pos, node)
- minetest.add_particlespawner({
- amount = 2,
- time = 1,
- minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1},
- maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1},
- minvel = {x=0, y=0.5, z=0},
- maxvel = {x=0, y=0.6, z=0},
- minacc = {x=0, y=0.2, z=0},
- maxacc = {x=0, y=0.3, z=0},
- minexptime = 1,
- maxexptime = 2,
- minsize = 2,
- maxsize = 3,
- collisiondetection = false,
- texture = "witchcraft_symbol.png"
- })
- end
- })
- minetest.register_abm({
- nodenames = {"witchcraft:pot_orange"},
- interval = 0.5,
- chance = 1,
- action = function(pos, node)
- minetest.add_particlespawner({
- amount = 2,
- time = 1,
- minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1},
- maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1},
- minvel = {x=0, y=0.5, z=0},
- maxvel = {x=0, y=0.6, z=0},
- minacc = {x=0, y=0.2, z=0},
- maxacc = {x=0, y=0.3, z=0},
- minexptime = 1,
- maxexptime = 2,
- minsize = 2,
- maxsize = 3,
- collisiondetection = false,
- texture = "witchcraft_flame.png"
- })
- end
- })
- --small bottle and contents
- minetest.register_node("witchcraft:small_bottle", {
- description = "Small bottle",
- drawtype = "plantlike",
- tiles = {"witchcraft_small_bottle.png"},
- wield_image = "witchcraft_small_bottle.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_small_bottle.png",
- })
- minetest.register_node("witchcraft:bone_bottle", {
- description = "Small bottle of bone dust",
- drawtype = "plantlike",
- tiles = {"witchcraft_bone_bottle.png"},
- wield_image = "witchcraft_bone_bottle.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_bone_bottle.png",
- })
- minetest.register_node("witchcraft:slime_bottle", {
- description = "Small bottle of slime",
- drawtype = "plantlike",
- tiles = {"witchcraft_slime_bottle.png"},
- wield_image = "witchcraft_slime_bottle.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_slime_bottle.png",
- })
- minetest.register_node("witchcraft:herb_bottle", {
- description = "Small bottle of herbs",
- drawtype = "plantlike",
- tiles = {"witchcraft_herb_bottle.png"},
- wield_image = "witchcraft_herb_bottle.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_herb_bottle.png",
- })
- minetest.register_node("witchcraft:mud_bottle", {
- description = "Small bottle of mud",
- drawtype = "plantlike",
- tiles = {"witchcraft_mud_bottle.png"},
- wield_image = "witchcraft_mud_bottle.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_mud_bottle.png",
- })
- minetest.register_node("witchcraft:bottle_medicine", {
- description = "Small bottle of Medicine",
- drawtype = "plantlike",
- tiles = {"witchcraft_medicine_bottle.png"},
- wield_image = "witchcraft_medicine_bottle.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_medicine_bottle.png",
- on_use = function(itemstack, player)
- local health = player:get_hp();
- player:set_hp(health+10)
- itemstack:replace("witchcraft:small_bottle")
- return itemstack
- end,
- })
- --splash effects
- minetest.register_entity("witchcraft:tnt_splash", {
- textures = {"witchcraft_splash_yellgrn.png"},
- velocity = 0.1,
- damage = 2,
- collisionbox = {0, 0, 0, 0, 0, 0},
- on_step = function(self, obj, pos)
- local remove = minetest.after(2, function()
- self.object:remove()
- end)
- local pos = self.object:getpos()
- local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
- for k, obj in pairs(objs) do
- if obj:get_luaentity() ~= nil then
- if obj:get_luaentity().name ~= "witchcraft:tnt_splash" and obj:get_luaentity().name ~= "__builtin:item" then
- obj:punch(self.object, 1.0, {
- full_punch_interval=1.0,
- damage_groups={fleshy=3},
- }, nil)
- tnt.boom(pos, {damage_radius=5,radius=3,ignore_protection=false})
- self.object:remove()
- end
- end
- end
- for dx=0,1 do
- for dy=0,1 do
- for dz=0,1 do
- local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(p).name
- if n ~= "witchcraft:tnt_splash" and n ~="default:obsidian" and n ~= "air" then
- local pos = self.object:getpos()
- minetest.sound_play("default_break_glass.1", {
- pos = self.object:getpos(),
- gaint = 1.0,
- max_hear_distance = 20,
- })
- tnt.boom(pos, {damage_radius=5,radius=3,ignore_protection=false})
- self.object:remove()
- return
- end
- end
- end
- end
- hit_node = function(self, pos, node)
- local pos = self.object:getpos()
- for dx=-4,4 do
- for dy=-4,4 do
- for dz=-4,4 do
- local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(pos).name
- if math.random(1, 50) <= 35 then
- tnt.boom(n, {damage_radius=5,radius=3,ignore_protection=false})
- end
- if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then
- if not ignore_protection and minetest.is_protected(npos, "") then
- return
- end
- minetest.env:set_node(t, {name="fire:basic_flame"})
- end
- end
- end
- end
- end
-
- end,
- })
- minetest.register_entity("witchcraft:fire_splash", {
- textures = {"witchcraft_splash_orange.png"},
- velocity = 0.1,
- damage = 2,
- collisionbox = {0, 0, 0, 0, 0, 0},
- on_step = function(self, obj, pos)
- local remove = minetest.after(2, function()
- self.object:remove()
- end)
- local pos = self.object:getpos()
- local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
- for k, obj in pairs(objs) do
- if obj:get_luaentity() ~= nil then
- if obj:get_luaentity().name ~= "witchcraft:fire_splash" and obj:get_luaentity().name ~= "__builtin:item" then
- obj:punch(self.object, 1.0, {
- full_punch_interval=1.0,
- damage_groups={fleshy=1},
- }, nil)
- self.object:remove()
- end
- end
- end
- for dx=0,1 do
- for dy=0,1 do
- for dz=0,1 do
- local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(p).name
- if n ~= "witchcraft:fire_splash" and n ~= "air" then
- if not ignore_protection and minetest.is_protected(npos, "") then
- return
- end
- minetest.env:set_node(t, {name="fire:basic_flame"})
- minetest.sound_play("default_break_glass.1", {
- pos = self.object:getpos(),
- max_hear_distance = 20,
- gain = 10.0,
- })
- self.object:remove()
- elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
- self.object:remove()
- return
- end
- end
- end
- end
- hit_node = function(self, pos, node)
- local pos = self.object:getpos()
- for dx=-4,4 do
- for dy=-4,4 do
- for dz=-4,4 do
- local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(pos).name
- if math.random(1, 50) <= 1 then
- minetest.env:remove_node(p)
- end
- if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then
- minetest.env:set_node(t, {name="fire:basic_flame"})
- end
- end
- end
- end
- end
-
- end,
- })
- minetest.register_entity("witchcraft:death_splash", {
- textures = {"witchcraft_splash_grey.png"},
- velocity = 0.1,
- damage = 2,
- collisionbox = {0, 0, 0, 0, 0, 0},
- on_step = function(self, obj, pos)
- local remove = minetest.after(2, function()
- self.object:remove()
- end)
- local pos = self.object:getpos()
- local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
- for k, obj in pairs(objs) do
- if obj:get_luaentity() ~= nil then
- if obj:get_luaentity().name ~= "witchcraft:death_splash" and obj:get_luaentity().name ~= "__builtin:item" then
- obj:punch(self.object, 1.0, {
- full_punch_interval=1.0,
- damage_groups={fleshy=50},
- }, nil)
- self.object:remove()
- end
- end
- end
- for dx=0,1 do
- for dy=0,1 do
- for dz=0,1 do
- local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(p).name
- if n ~= "witchcraft:death_splash" and n ~= "air" then
- minetest.sound_play("default_break_glass.1", {
- pos = self.object:getpos(),
- max_hear_distance = 20,
- gain = 10.0,
- })
- self.object:remove()
- elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
- self.object:remove()
- return
- end
- end
- end
- end
-
-
- end,
- })
- minetest.register_entity("witchcraft:heal_splash", {
- textures = {"witchcraft_splash_red.png"},
- velocity = 0.1,
- damage = 2,
- collisionbox = {0, 0, 0, 0, 0, 0},
- on_step = function(self, obj, pos)
- local remove = minetest.after(2, function()
- self.object:remove()
- end)
- local pos = self.object:getpos()
- local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
- for k, obj in pairs(objs) do
- if obj:get_luaentity() ~= nil then
- if obj:get_luaentity().name ~= "witchcraft:heal_splash" and obj:get_luaentity().name ~= "__builtin:item" then
- obj:punch(self.object, 1.0, {
- full_punch_interval=1.0,
- damage_groups={fleshy=-20},
- }, nil)
- self.object:remove()
- end
- end
- end
- for dx=0,1 do
- for dy=0,1 do
- for dz=0,1 do
- local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(p).name
- if n ~= "witchcraft:heal_splash" and n ~= "air" then
- minetest.sound_play("default_break_glass.1", {
- pos = self.object:getpos(),
- max_hear_distance = 20,
- gain = 10.0,
- })
- self.object:remove()
- elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
- self.object:remove()
- return
- end
- end
- end
- end
-
-
- end,
- })
- minetest.register_entity("witchcraft:slow_splash", {
- textures = {"witchcraft_splash_redbrown.png"},
- velocity = 0.1,
- damage = 2,
- collisionbox = {0, 0, 0, 0, 0, 0},
- on_step = function(self, obj, pos)
- local remove = minetest.after(2, function()
- self.object:remove()
- end)
- local pos = self.object:getpos()
- local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
- for k, obj in pairs(objs) do
- if obj:get_luaentity() ~= nil then
- if obj:get_luaentity().name ~= "witchcraft:slow_splash" and obj:get_luaentity().name ~= "__builtin:item" then
- local vel = obj:getvelocity()
- obj:setvelocity({x=vel.x*0.5, y=vel.y*0.5, z=vel.z*0.5})
- self.object:remove()
- end
- end
- end
- for dx=0,1 do
- for dy=0,1 do
- for dz=0,1 do
- local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(p).name
- if n ~= "witchcraft:slow_splash" and n ~= "air" then
-
- self.object:remove()
- elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
- minetest.sound_play("default_break_glass.1", {
- pos = self.object:getpos(),
- max_hear_distance = 20,
- gain = 10.0,
- })
- self.object:remove()
- return
- end
- end
- end
- end
-
-
- end,
- })
- minetest.register_entity("witchcraft:fast_splash", {
- textures = {"witchcraft_splash_magenta.png"},
- velocity = 0.1,
- damage = 2,
- collisionbox = {0, 0, 0, 0, 0, 0},
- on_step = function(self, obj, pos)
- local remove = minetest.after(2, function()
- self.object:remove()
- end)
- local pos = self.object:getpos()
- local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
- for k, obj in pairs(objs) do
- if obj:get_luaentity() ~= nil then
- if obj:get_luaentity().name ~= "witchcraft:fast_splash" and obj:get_luaentity().name ~= "__builtin:item" then
- local vel = obj:getvelocity()
- obj:setvelocity({x=vel.x*4, y=vel.y*1, z=vel.z*4})
- self.object:remove()
- end
- end
- end
- for dx=0,1 do
- for dy=0,1 do
- for dz=0,1 do
- local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(p).name
- if n ~= "witchcraft:fast_splash" and n ~= "air" then
-
- self.object:remove()
- elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
- minetest.sound_play("default_break_glass.1", {
- pos = self.object:getpos(),
- max_hear_distance = 20,
- gain = 10.0,
- })
- self.object:remove()
- return
- end
- end
- end
- end
-
-
- end,
- })
- minetest.register_entity("witchcraft:antigrav_splash", {
- textures = {"witchcraft_splash_green.png"},
- velocity = 0.1,
- damage = 2,
- collisionbox = {0, 0, 0, 0, 0, 0},
- on_step = function(self, obj, pos)
- local remove = minetest.after(2, function()
- self.object:remove()
- end)
- local pos = self.object:getpos()
- local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
- for k, obj in pairs(objs) do
- if obj:get_luaentity() ~= nil then
- if obj:get_luaentity().name ~= "witchcraft:antigrav_splash" and obj:get_luaentity().name ~= "__builtin:item" then
- local vel = obj:getvelocity()
- obj:setvelocity({x=vel.x*1, y=vel.y*0.1, z=vel.z*1})
- self.object:remove()
- end
- end
- end
- for dx=0,1 do
- for dy=0,1 do
- for dz=0,1 do
- local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(p).name
- if n ~= "witchcraft:antigrav_splash" and n ~= "air" then
-
- self.object:remove()
- elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
- minetest.sound_play("default_break_glass.1", {
- pos = self.object:getpos(),
- max_hear_distance = 20,
- gain = 10.0,
- })
- self.object:remove()
- return
- end
- end
- end
- end
-
-
- end,
- })
- minetest.register_entity("witchcraft:jump_splash", {
- textures = {"witchcraft_splash_cyan.png"},
- velocity = 0.1,
- damage = 2,
- collisionbox = {0, 0, 0, 0, 0, 0},
- on_step = function(self, obj, pos)
- local remove = minetest.after(2, function()
- self.object:remove()
- end)
- local pos = self.object:getpos()
- local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
- for k, obj in pairs(objs) do
- if obj:get_luaentity() ~= nil then
- if obj:get_luaentity().name ~= "witchcraft:jump_splash" and obj:get_luaentity().name ~= "__builtin:item" then
- local vel = obj:getvelocity()
- obj:setvelocity({x=vel.x*1, y=(vel.y+2)*3, z=vel.z*1})
- self.object:remove()
- end
- end
- end
- for dx=0,1 do
- for dy=0,1 do
- for dz=0,1 do
- local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(p).name
- if n ~= "witchcraft:jump_splash" and n ~= "air" then
-
- self.object:remove()
- elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
- minetest.sound_play("default_break_glass.1", {
- pos = self.object:getpos(),
- max_hear_distance = 20,
- gain = 10.0,
- })
- self.object:remove()
- return
- end
- end
- end
- end
-
-
- end,
- })
- minetest.register_entity("witchcraft:murky_splash", {
- textures = {"witchcraft_splash_brown.png"},
- velocity = 0.1,
- damage = 2,
- collisionbox = {0, 0, 0, 0, 0, 0},
- on_step = function(self, obj, pos)
- local remove = minetest.after(2, function()
- self.object:remove()
- end)
- local pos = self.object:getpos()
- local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
- for k, obj in pairs(objs) do
- if obj:get_luaentity() ~= nil then
- if obj:get_luaentity().name ~= "witchcraft:murky_splash" and obj:get_luaentity().name ~= "__builtin:item" then
- obj:punch(self.object, 1.0, {
- full_punch_interval=1.0,
- damage_groups={fleshy=20},
- }, nil)
- self.object:remove()
- end
- end
- end
- for dx=0,1 do
- for dy=0,1 do
- for dz=0,1 do
- local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(p).name
- if n ~= "witchcraft:murky_splash" and n ~= "air" then
- minetest.sound_play("default_break_glass.1", {
- pos = self.object:getpos(),
- max_hear_distance = 20,
- gain = 10.0,
- })
- self.object:remove()
- elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
- self.object:remove()
- return
- end
- end
- end
- end
-
-
- end,
- })
- minetest.register_entity("witchcraft:shadow_splash", {
- textures = {"witchcraft_splash_ggreen.png"},
- velocity = 0.1,
- damage = 2,
- physical = true,
- collisionbox = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
- on_step = function(self, obj, pos)
- local remove = minetest.after(5, function()
- self.object:remove()
- end)
- local pos = self.object:getpos()
- minetest.add_particlespawner(
- 50, --amount
- 1, --time
- {x=pos.x-3, y=pos.y-3, z=pos.z-3}, --minpos
- {x=pos.x+3, y=pos.y+3, z=pos.z+3}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.1,y=0.2,z=-0.1}, --minacc
- {x=0.1,y=0.2,z=0.1}, --maxacc
- 5, --minexptime
- 10, --maxexptime
- 10, --minsize
- 20, --maxsize
- false, --collisiondetection
- "witchcraft_pot_bottom.png^[colorize:black:200" --texture
- )
- end,
- })
- minetest.register_entity("witchcraft:smoke_splash", {
- textures = {"witchcraft_splash_purple.png"},
- velocity = 0.1,
- damage = 2,
- physical = true,
- collisionbox = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
- on_step = function(self, obj, pos)
- local remove = minetest.after(10, function()
- self.object:remove()
- end)
- local pos = self.object:getpos()
- local velo = self.object:getvelocity()
- self.object:setvelocity({x=velo.x*0.9,y=velo.y,z=velo.z*0.9})
- minetest.add_particlespawner(
- 10, --amount
- 1, --time
- {x=pos.x-1, y=pos.y-1, z=pos.z-1}, --minpos
- {x=pos.x+1, y=pos.y+1, z=pos.z+1}, --maxpos
- {x=-1, y=-0, z=-1}, --minvel
- {x=1, y=0, z=1}, --maxvel
- {x=-0.5,y=2,z=-0.5}, --minacc
- {x=0.5,y=3,z=0.5}, --maxacc
- 2, --minexptime
- 4, --maxexptime
- 10, --minsize
- 20, --maxsize
- false, --collisiondetection
- "witchcraft_smoke.png" --texture
- )
-
- end,
- })
- --player effects
- local register_effect = playereffects.register_effect_type
- if minetest.get_modpath("player_monoids") then
- local speed = player_monoids.speed
- local jump = player_monoids.jump
- local gravity = player_monoids.gravity
- register_effect("witchcraft:potion_speed_lv1", "High Speed", nil,
- {"witchcraft:potion_speed_lv1"},
- function(player)
- speed:add_change(player, 2, "witchcraft:potion_speed_lv1")
- end,
- function(effect, player)
- speed:del_change(player, "witchcraft:potion_speed_lv1")
- end,
- false
- )
- register_effect("witchcraft:potion_speed_lv2", "High Speed", nil,
- {"witchcraft:potion_speed_lv2"},
- function(player)
- speed:add_change(player, 2.5, "witchcraft:potion_speed_lv2")
- end,
- function(effect, player)
- speed:del_change(player, "witchcraft:potion_speed_lv2")
- end,
- false
- )
- register_effect("witchcraft:potion_jump_lvx", "High Jump", nil,
- {"witchcraft:potion_jump_lvx"},
- function(player)
- jump:add_change(player, 1.5, "witchcraft:potion_jump_lvx")
- gravity:add_change(player, 0.8, "witchcraft:potion_jump_lvx")
- end,
- function(effect, player)
- jump:del_change(player, "witchcraft:potion_jump_lvx")
- gravity:del_change(player, "witchcraft:potion_jump_lvx")
- end,
- false
- )
- register_effect("witchcraft:potion_antigrav_lvx", "Light weight", nil,
- {"witchcraft:potion_antigrav_lvx"},
- function(player)
- gravity:add_change(player, 0.1, "witchcraft:potion_antigrav_lvx")
- end,
- function(effect, player)
- gravity:del_change(player, "witchcraft:potion_antigrav_lvx")
- end,
- false
- )
- register_effect("witchcraft:potion_slow_lv1", "Low Speed", nil,
- {"witchcraft:potion_slow_lv1"},
- function(player)
- speed:add_change(player, 0.5, "witchcraft:potion_slow_lv1")
- end,
- function(effect, player)
- speed:del_change(player, "witchcraft:potion_slow_lv1")
- end,
- false
- )
- register_effect("witchcraft:potion_slow_lv2", "Low Speed", nil,
- {"witchcraft:potion_slow_lv2"},
- function(player)
- speed:add_change(player, 0.4, "witchcraft:potion_slow_lv2")
- end,
- function(effect, player)
- speed:del_change(player, "witchcraft:potion_slow_lv2")
- end,
- false
- )
- register_effect("witchcraft:potion_swim_lv1", "Fast Swim", nil,
- {"witchcraft:potion_swim_lv1"},
- function(player)
- speed:add_change(player, 3, "witchcraft:potion_swim_lv1")
- end,
- function(effect, player)
- speed:del_change(player, "witchcraft:potion_swim_lv1")
- end,
- false
- )
- register_effect("witchcraft:potion_swim_lv2", "Dive", nil,
- {"witchcraft:potion_swim_lv2"},
- function(player)
- speed:add_change(player, 3, "witchcraft:potion_swim_lv2")
- gravity:add_change(player, 4, "witchcraft:potion_swim_lv2")
- end,
- function(effect, player)
- speed:del_change(player, "witchcraft:potion_swim_lv2")
- gravity:del_change(player, "witchcraft:potion_swim_lv2")
- end,
- false
- )
- else
- local function playereffects_register(effect_id, desc, groups, spd, jmp,
- grav, spd2, jmp2, grav2)
- register_effect(effect_id, desc, nil, groups,
- function(player)
- player:set_physics_override(spd,jmp,grav)
- end,
- function(effect, player)
- player:set_physics_override(spd2,jmp2,grav2)
- end,
- false
- )
- end
- playereffects_register("witchcraft:potion_speed_lv1", "High speed",
- {"speed"}, 2, nil, nil, 1, nil, nil)
- playereffects_register("witchcraft:potion_speed_lv2", "High speed",
- {"speed"}, 2.5, nil, nil, 1, nil, nil)
- playereffects_register("witchcraft:potion_jump_lvx", "High Jump",
- {"jump"}, nil, 1.5, 0.8, nil, 1, 1)
- playereffects_register("witchcraft:potion_antigrav_lvx", "Light weight",
- {"gravity"}, nil, nil, 0.1, nil, nil, 1)
- playereffects_register("witchcraft:potion_slow_lv1", "Low speed",
- {"speed"}, 0.5, nil, nil, 1, nil, nil)
- playereffects_register("witchcraft:potion_slow_lv2", "Low speed",
- {"speed"}, 0.4, nil, nil, 1, nil, nil)
- playereffects_register("witchcraft:potion_swim_lv1", "Fast Swim",
- {"swim"}, 3, nil, nil, 1, nil, nil)
- playereffects_register("witchcraft:potion_swim_lv2", "Dive",
- {"swim"}, 3, nil, 4, 1, nil, 1)
- end
- register_effect("potion_silver", "Fire resist", nil, {"fire_resist"},
- function(player)
- local pos = player:getpos()
- local node = minetest.get_node(pos).name
- if node == "default:lava_source" or node == "default:lava_flowing" or node == "fire:basic_flame" then
- local hp1 = player:get_hp()
- minetest.after(0.8, function()
- local hp2 = player:get_hp()
- local change = hp1-hp2
- if change >= 0 then
- player:set_hp(hp2+change)
- end
- end)
- end
- end,
- nil,
- nil,
- nil,
- 0.3
- )
- --splash potions
- minetest.register_node("witchcraft:splash_orange", {
- description = "Dragon Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_orange.png"},
- wield_image = "witchcraft_splash_orange.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_orange.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6}
- local acc = {x=0,y=-9.8,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- minetest.register_node("witchcraft:splash_purple", {
- description = "Smokey Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_purple.png"},
- wield_image = "witchcraft_splash_purple.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_purple.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
- local acc = {x=0,y=-9.8,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z}, "witchcraft:smoke_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- minetest.register_node("witchcraft:splash_red", {
- description = "Healthy Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_red.png"},
- wield_image = "witchcraft_splash_red.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_red.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
- local acc = {x=0,y=-9,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:heal_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- minetest.register_node("witchcraft:splash_green", {
- description = "Volatile Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_green.png"},
- wield_image = "witchcraft_splash_green.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_green.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
- local acc = {x=0,y=-9,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:jump_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- minetest.register_node("witchcraft:splash_cyan", {
- description = "Light Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_cyan.png"},
- wield_image = "witchcraft_splash_cyan.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_cyan.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
- local acc = {x=0,y=-9,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:antigrav_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- minetest.register_node("witchcraft:splash_redbrown", {
- description = "Thick Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_redbrown.png"},
- wield_image = "witchcraft_splash_redbrown.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_redbrown.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
- local acc = {x=0,y=-9,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:slow_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- minetest.register_node("witchcraft:splash_magenta", {
- description = "Fast Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_magenta.png"},
- wield_image = "witchcraft_splash_magenta.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_magenta.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*13,y=dir.y*2.5,z=dir.z*13}
- local acc = {x=0,y=-9,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:fast_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- minetest.register_node("witchcraft:splash_brown", {
- description = "Murky Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_brown.png"},
- wield_image = "witchcraft_splash_brown.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_brown.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
- local acc = {x=0,y=-9,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:murky_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- minetest.register_node("witchcraft:splash_grey", {
- description = "Death Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_grey.png"},
- wield_image = "witchcraft_splash_grey.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_grey.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
- local acc = {x=0,y=-9,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:death_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- minetest.register_node("witchcraft:splash_ggreen", {
- description = "Darkness Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_ggreen.png"},
- wield_image = "witchcraft_splash_ggreen.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_ggreen.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6}
- local acc = {x=0,y=-9.8,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:shadow_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- minetest.register_node("witchcraft:splash_yellwgrn", {
- description = "Dodgy Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_yellgrn.png"},
- wield_image = "witchcraft_splash_yellgrn.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_yellgrn.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*7,y=dir.y*3.5,z=dir.z*7}
- local acc = {x=0,y=-9.8,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tnt_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- --potions (level 1 and 2)
- minetest.register_node("witchcraft:potion_red", {
- description = "Tasty Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_red.png"},
- wield_image = "witchcraft_potion_red.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_red.png",
- on_use = function(itemstack, player)
- local health = player:get_hp();
- player:set_hp(health+20)
- itemstack:replace("vessels:glass_bottle")
- return itemstack
- end,
- })
- minetest.register_node("witchcraft:potion_red_2", {
- description = "Tasty Potion (lv2)",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_red.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_red.png^[colorize:black:50",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_red.png^[colorize:black:50",
- on_use = function(itemstack, player)
- local health = player:get_hp();
- player:set_hp(health+50)
- itemstack:replace("vessels:glass_bottle")
- return itemstack
- end,
- })
- minetest.register_node("witchcraft:potion_darkpurple", {
- description = "Shady Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_darkpurple.png"},
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- stack_max = 1,
- wield_image = "witchcraft_potion_darkpurple.png",
- inventory_image = "witchcraft_potion_darkpurple.png",
- on_use = function(itemstack, user)
- --invisibility effect from invisibility potion by Tenplus1
- local pos = user:getpos()
- -- make player invisible
- invisible(user, true)
- -- play sound
- minetest.sound_play("pop", {
- pos = pos,
- gain = 1.0,
- max_hear_distance = 5
- })
- -- display 10 second warning
- minetest.after(290, function()
- if user:getpos() then
- minetest.chat_send_player(user:get_player_name(),
- ">>> You have 10 seconds before invisibility wears off!")
- end
- end)
- -- make player visible 5 minutes later
- minetest.after(300, function()
- if user:getpos() then
- -- show aready hidden player
- invisible(user, nil)
- -- play sound
- minetest.sound_play("pop", {
- pos = pos,
- gain = 1.0,
- max_hear_distance = 5
- })
- end
- end)
- --effect
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
-
- -- take item
- if not minetest.setting_getbool("creative_mode") then
- itemstack:take_item()
- return {name = "vessels:glass_bottle"}
- end
- end,
- })
- minetest.register_node("witchcraft:potion_darkpurple_2", {
- description = "Shady Potion (lv2)",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_darkpurple.png^[colorize:black:50"},
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- paramtype = "light",
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- stack_max = 1,
- wield_image = "witchcraft_potion_darkpurple.png^[colorize:black:50",
- inventory_image = "witchcraft_potion_darkpurple.png^[colorize:black:50",
- on_use = function(itemstack, user)
- local pos = user:getpos()
- -- make player invisible
- invisible(user, true)
- -- play sound
- minetest.sound_play("pop", {
- pos = pos,
- gain = 1.0,
- max_hear_distance = 5
- })
- -- display 10 second warning
- minetest.after(340, function()
- if user:getpos() then
- minetest.chat_send_player(user:get_player_name(),
- ">>> You have 10 seconds before invisibility wears off!")
- end
- end)
- -- make player visible 5 minutes later
- minetest.after(350, function()
- if user:getpos() then
- -- show aready hidden player
- invisible(user, nil)
- -- play sound
- minetest.sound_play("pop", {
- pos = pos,
- gain = 1.0,
- max_hear_distance = 5
- })
- end
- end)
- --effect
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
-
- -- take item
- if not minetest.setting_getbool("creative_mode") then
- itemstack:take_item()
- return {name = "vessels:glass_bottle"}
- end
- end,
- })
- minetest.register_node("witchcraft:potion_brown", {
- description = "Murky Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_brown.png"},
- wield_image = "witchcraft_potion_brown.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_brown.png",
- on_use = minetest.item_eat(-5, "vessels:glass_bottle"),
- })
- minetest.register_node("witchcraft:potion_brown_2", {
- description = "Murky Potion (lv2)",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_brown.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_brown.png^[colorize:black:50",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_brown.png^[colorize:black:50",
- on_use = minetest.item_eat(-10, "vessels:glass_bottle"),
- })
- --cannot get the potion to be removed from inventory on use?
- minetest.register_node("witchcraft:potion_yllwgrn", {
- description = "Dodgy Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_yellgrn.png"},
- wield_image = "witchcraft_potion_yellgrn.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_yellgrn.png",
- on_use = function(pos, placer, itemstack)
- local pos = placer:getpos();
- tnt.boom(pos, {damage_radius=5,radius=3,ignore_protection=false})
- return itemstack
- end,
- })
- minetest.register_node("witchcraft:potion_yllwgrn_2", {
- description = "Dodgy Potion (lv2)",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_yellgrn.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_yellgrn.png^[colorize:black:50",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_yellgrn.png^[colorize:black:50",
- on_use = function(pos, placer, itemstack)
- local pos = placer:getpos();
- tnt.boom(pos, {damage_radius=10,radius=4,ignore_protection=false})
- return itemstack
- end,
- })
- minetest.register_entity("witchcraft:fire", {
- textures = {"witchcraft_flame.png"},
- velocity = 0.1,
- damage = 2,
- collisionbox = {0, 0, 0, 0, 0, 0},
- on_step = function(self, obj, pos)
- local remove = minetest.after(2, function()
- self.object:remove()
- end)
- local pos = self.object:getpos()
- local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
- for k, obj in pairs(objs) do
- if obj:get_luaentity() ~= nil then
- if obj:get_luaentity().name ~= "witchcraft:fire" and obj:get_luaentity().name ~= "__builtin:item" then
- obj:punch(self.object, 1.0, {
- full_punch_interval=1.0,
- damage_groups={fleshy=3},
- }, nil)
- self.object:remove()
- end
- end
- end
- for dx=0,1 do
- for dy=0,1 do
- for dz=0,1 do
- local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(p).name
- if n ~= "witchcraft:fire" and n ~= "air" and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" then
- minetest.env:set_node(t, {name="fire:basic_flame"})
- elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
- self.object:remove()
- return
- end
- end
- end
- end
- hit_node = function(self, pos, node)
- local pos = self.object:getpos()
- for dx=-4,4 do
- for dy=-4,4 do
- for dz=-4,4 do
- local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
- local n = minetest.env:get_node(pos).name
- if math.random(1, 50) <= 35 then
- minetest.env:remove_node(p)
- end
- if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then
- minetest.env:set_node(t, {name="fire:basic_flame"})
- end
- end
- end
- end
- end
- local apos = self.object:getpos()
- local part = minetest.add_particlespawner(
- 10, --amount
- 0.3, --time
- {x=apos.x-0.3, y=apos.y-0.3, z=apos.z-0.3}, --minpos
- {x=apos.x+0.3, y=apos.y+0.3, z=apos.z+0.3}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=0,y=-0.5,z=0}, --minacc
- {x=0.5,y=0.5,z=0.5}, --maxacc
- 1, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_flame.png" --texture
- )
-
- end,
- })
- minetest.register_node("witchcraft:potion_orange", {
- description = "Dragon Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_orange.png"},
- wield_image = "witchcraft_potion_orange.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_orange.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire")
- obj:setvelocity(vec)
- local part = minetest.add_particlespawner(
- 10, --amount
- 0.3, --time
- {x=playerpos.x-0.3, y=playerpos.y+1.5, z=playerpos.z-0.3}, --minpos
- {x=playerpos.x+0.3, y=playerpos.y+1.5, z=playerpos.z+0.3}, --maxpos
- {x=dir.x*3,y=dir.y*3,z=dir.z*3}, --minvel
- {x=dir.x*3,y=dir.y*3,z=dir.z*3}, --maxvel
- {x=0,y=-0.5,z=0}, --minacc
- {x=0.5,y=0.5,z=0.5}, --maxacc
- 1, --minexptime
- 2, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_flame.png" --texture
- )
-
- item:replace("vessels:glass_bottle")
- return item
- end,
- })
- minetest.register_node("witchcraft:potion_orange_2", {
- description = "Dragon Potion (v2)",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_orange.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_orange.png^[colorize:black:50",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_orange.png^[colorize:black:50",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*3,y=dir.y*3.5,z=dir.z*3}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire")
- obj:setvelocity(vec)
- local part = minetest.add_particlespawner(
- 10, --amount
- 0.3, --time
- {x=playerpos.x-0.3, y=playerpos.y+1.5, z=playerpos.z-0.3}, --minpos
- {x=playerpos.x+0.3, y=playerpos.y+1.5, z=playerpos.z+0.3}, --maxpos
- {x=dir.x*3,y=dir.y*3,z=dir.z*3}, --minvel
- {x=dir.x*3,y=dir.y*3,z=dir.z*3}, --maxvel
- {x=0,y=-0.5,z=0}, --minacc
- {x=0.5,y=0.5,z=0.5}, --maxacc
- 1, --minexptime
- 2, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_flame.png^[colorize:blue:200" --texture
- )
-
- item:replace("vessels:glass_bottle")
- return item
- end,
- })
- minetest.register_node("witchcraft:splash_orange", {
- description = "Dragon Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_orange.png"},
- wield_image = "witchcraft_splash_orange.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_orange.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6}
- local acc = {x=0,y=-9.8,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- minetest.register_node("witchcraft:splash_yellwgrn", {
- description = "Dodgy Splash Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_splash_yellgrn.png"},
- wield_image = "witchcraft_splash_yellgrn.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_splash_yellgrn.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*7,y=dir.y*3.5,z=dir.z*7}
- local acc = {x=0,y=-9.8,z=0}
- local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tnt_splash")
- obj:setvelocity(vec)
- obj:setacceleration(acc)
- item:take_item()
- return item
- end,
- })
- minetest.register_node("witchcraft:potion_purple", {
- description = "Smokey Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_purple.png"},
- wield_image = "witchcraft_potion_purple.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_purple.png",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2}
- local part = minetest.add_particlespawner(
- 20, --amount
- 0.5, --time
- {x=playerpos.x-1, y=playerpos.y, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y, z=playerpos.z+1}, --maxpos
- {x=0,y=0.5,z=0}, --minvel
- {x=0,y=0.6,z=0}, --maxvel
- {x=0,y=-0.5,z=0}, --minacc
- {x=0,y=0.5,z=0}, --maxacc
- 1, --minexptime
- 3, --maxexptime
- 10, --minsize
- 15, --maxsize
- false, --collisiondetection
- "witchcraft_smoke.png^[colorize:magenta:50" --texture
- )
-
- item:replace("vessels:glass_bottle")
- return item
- end,
- })
- minetest.register_node("witchcraft:potion_gpurple", {
- description = "Filling Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_gpurple.png"},
- wield_image = "witchcraft_potion_gpurple.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_gpurple.png",
- on_use = minetest.item_eat(20, "vessels:glass_bottle"),
- })
- minetest.register_node("witchcraft:potion_gred", {
- description = "Hunger Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_gred.png"},
- wield_image = "witchcraft_potion_gred.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_gred.png",
- on_use = minetest.item_eat(-10, "vessels:glass_bottle"),
- })
- minetest.register_node("witchcraft:potion_purple_2", {
- description = "Smokey Potion (lv2)",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_purple.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_purple.png^[colorize:black:50",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_purple.png^[colorize:black:20",
- on_use = function(item, placer, pos)
- local dir = placer:get_look_dir();
- local playerpos = placer:getpos();
- local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2}
- local part = minetest.add_particlespawner(
- 20, --amount
- 0.5, --time
- {x=playerpos.x-1, y=playerpos.y, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y, z=playerpos.z+1}, --maxpos
- {x=0,y=0.2,z=0}, --minvel
- {x=0,y=0.2,z=0}, --maxvel
- {x=0,y=-0.1,z=0}, --minacc
- {x=0,y=0.1,z=0}, --maxacc
- 5, --minexptime
- 10, --maxexptime
- 10, --minsize
- 15, --maxsize
- false, --collisiondetection
- "witchcraft_smoke.png^[colorize:magenta:50" --texture
- )
-
- item:replace("vessels:glass_bottle")
- return item
- end,
- })
- minetest.register_node("witchcraft:potion_grey", {
- description = "Evil Potion",
- drawtype = "plantlike",
- stack_max = 1,
- tiles = {"witchcraft_potion_grey.png"},
- wield_image = "witchcraft_potion_grey.png",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_grey.png",
- on_use = minetest.item_eat(-100, "vessels:glass_bottle"),
- })
- minetest.register_node("witchcraft:potion_grey_2", {
- description = "Evil Potion (lv2)",
- drawtype = "plantlike",
- stack_max = 1,
- tiles = {"witchcraft_potion_grey.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_grey.png^[colorize:black:50",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_grey.png^[colorize:black:50",
- on_use = minetest.item_eat(-200, "vessels:glass_bottle"),
- })
- minetest.register_node("witchcraft:potion_blue", {
- description = "Bottle of Water",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_blue.png"},
- wield_image = "witchcraft_potion_blue.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_blue.png",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- if pointed_thing.type == "node" and
- minetest.get_node(pointed_thing.above).name == "air" then
- if not minetest.is_protected(pointed_thing.above, player) then
- minetest.set_node(pointed_thing.above, {name="default:water_source"})
- else
- minetest.chat_send_player(player, "This area is protected.")
- end
- end
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_silver", {
- description = "Cold potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_silver.png"},
- wield_image = "witchcraft_potion_silver.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_silver.png",
- on_use = function(item, user, pointed_thing)
- playereffects.apply_effect_type("potion_silver", 15, user)
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_silver_2", {
- description = "Cold potion lv2",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_silver.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_silver.png^[colorize:black:50",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_silver.png^[colorize:black:50",
- on_use = function(item, user, pointed_thing)
- playereffects.apply_effect_type("potion_silver", 60, user)
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- -- farming redo support
- local plant_desc
- local plant_act
- if farming.mod and farming.mod == "redo" then
- plant_desc = "Melon Potion"
- function plant_act (pointed_thing)
- minetest.set_node(pointed_thing, {name="farming:melon_8"})
- end
- else
- plant_desc = "Plant Potion (destructive!)"
- function plant_act (pointed_thing)
- default.grow_new_jungle_tree(pointed_thing)
- end
- end
- minetest.register_node("witchcraft:potion_green", {
- description = plant_desc,
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_green.png"},
- wield_image = "witchcraft_potion_green.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_green.png",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- if pointed_thing.type == "node" and
- minetest.get_node(pointed_thing.above).name == "air" then
- if not minetest.is_protected(pointed_thing.above, player) then
- plant_act(pointed_thing.above)
- else
- minetest.chat_send_player(player, "This area is protected.")
- end
- end
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_gold", {
- description = "Alchemy Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_gold.png"},
- wield_image = "witchcraft_potion_gold.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_gold.png",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- if pointed_thing.type == "node" and
- minetest.get_node(pointed_thing.above).name == "air" then
- if not minetest.is_protected(pointed_thing.above, player) then
- minetest.set_node(pointed_thing.above, {name="default:goldblock"})
- else
- minetest.chat_send_player(player, "This area is protected.")
- end
- end
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_gold_2", {
- description = "Alchemy Potion (lv2)",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_gold.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_gold.png^[colorize:black:50",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_gold.png^[colorize:black:50",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- if pointed_thing.type == "node" and
- minetest.get_node(pointed_thing.above).name == "air" then
- if not minetest.is_protected(pointed_thing.above, player) then
- minetest.set_node(pointed_thing.above, {name="default:diamondblock"})
- else
- minetest.chat_send_player(player, "This area is protected.")
- end
- end
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- if minetest.get_modpath("experience") then
- minetest.register_node("witchcraft:potion_aqua", {
- description = "Complex Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_aqua.png"},
- wield_image = "witchcraft_potion_aqua.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_aqua.png",
- on_use = function(item, placer, pos)
- local pos = placer:getpos();
- minetest.add_particlespawner(
- 6, --amount
- 0.1, --time
- {x=pos.x-1, y=pos.y+0.5, z=pos.z-1}, --minpos
- {x=pos.x+1, y=pos.y+1, z=pos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=2,z=-0.5}, --minacc
- {x=0.5,y=2,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "orb.png" --texture
- )
- minetest.env:add_entity(pos, "experience:orb")
- minetest.env:add_entity(pos, "experience:orb")
- minetest.env:add_entity(pos, "experience:orb")
- minetest.env:add_entity(pos, "experience:orb")
- minetest.env:add_entity(pos, "experience:orb")
-
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- else
- minetest.register_node("witchcraft:potion_aqua", {
- description = "Complex Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_aqua.png"},
- wield_image = "witchcraft_potion_aqua.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_aqua.png",
- on_use = function(item, placer, pos)
- local pos = placer:getpos();
- minetest.add_particlespawner(
- 6, --amount
- 0.1, --time
- {x=pos.x-1, y=pos.y+0.5, z=pos.z-1}, --minpos
- {x=pos.x+1, y=pos.y+1, z=pos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=2,z=-0.5}, --minacc
- {x=0.5,y=2,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- minetest.add_item(pos, "default:steel_ingot")
- minetest.add_item(pos, "witchcraft:herb")
- minetest.add_item(pos, "default:mese_crystal")
- minetest.add_item(pos, "default:gold_lump")
- minetest.add_item(pos, "farming:bread")
- minetest.add_item(pos, "default:copper_ingot")
-
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- end
- minetest.register_node("witchcraft:potion_magenta", {
- description = "Fast Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_magenta.png"},
- wield_image = "witchcraft_potion_magenta.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_magenta.png",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- local breath_change = user:set_breath(5)
- playereffects.apply_effect_type("witchcraft:potion_speed_lv1", 10, user)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_magenta_2", {
- description = "Fast Potion (lv2)",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_magenta.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_magenta.png^[colorize:black:50",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_magenta.png^[colorize:black:50",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- local breath_change = user:set_breath(5)
- playereffects.apply_effect_type("witchcraft:potion_speed_lv2", 10, user)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_cyan", {
- description = "Light Potion",
- drawtype = "plantlike",
- stack_max = 1,
- tiles = {"witchcraft_potion_cyan.png"},
- wield_image = "witchcraft_potion_cyan.png",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_cyan.png",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- local breath_change = user:set_breath(5)
- playereffects.apply_effect_type("witchcraft:potion_antigrav_lvx", 10, user)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_gcyan", {
- description = "Air Potion",
- drawtype = "plantlike",
- stack_max = 1,
- tiles = {"witchcraft_potion_gcyan.png"},
- wield_image = "witchcraft_potion_gcyan.png",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_gcyan.png",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- local breath_change = user:set_breath(12)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_cyan_2", {
- description = "Light Potion (lv2)",
- drawtype = "plantlike",
- stack_max = 1,
- tiles = {"witchcraft_potion_cyan.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_cyan.png^[colorize:black:50",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_cyan.png^[colorize:black:50",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- local breath_change = user:set_breath(5)
- playereffects.apply_effect_type("witchcraft:potion_antigrav_lvx", 20, user)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_green2", {
- description = "Volatile Potion",
- drawtype = "plantlike",
- stack_max = 1,
- tiles = {"witchcraft_potion_green2.png"},
- wield_image = "witchcraft_potion_green2.png",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_green2.png",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- local breath_change = user:set_breath(5)
- playereffects.apply_effect_type("witchcraft:potion_jump_lvx", 6, user)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_ggreen", {
- description = "Darkness Potion",
- drawtype = "plantlike",
- stack_max = 1,
- tiles = {"witchcraft_potion_ggreen.png"},
- wield_image = "witchcraft_potion_ggreen.png",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_ggreen.png",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 2000, --amount
- 1, --time
- {x=playerpos.x-20, y=playerpos.y-3, z=playerpos.z-20}, --minpos
- {x=playerpos.x+20, y=playerpos.y+3, z=playerpos.z+20}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.1,y=0,z=-0.1}, --minacc
- {x=0.1,y=0,z=0.1}, --maxacc
- 5, --minexptime
- 10, --maxexptime
- 10, --minsize
- 20, --maxsize
- false, --collisiondetection
- "witchcraft_pot_bottom.png^[colorize:black:200" --texture
- )
- local mtime = minetest.get_timeofday()
- if mtime >= 0.25 and mtime <= 0.75 then
- user:override_day_night_ratio(-mtime+0.5)
- minetest.after(10, function()
- user:override_day_night_ratio(nil)
- end)
- end
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_green2_2", {
- description = "Volatile Potion (lv2)",
- drawtype = "plantlike",
- stack_max = 1,
- tiles = {"witchcraft_potion_green2.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_green2.png^[colorize:black:50",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_green2.png^[colorize:black:50",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- local breath_change = user:set_breath(5)
- playereffects.apply_effect_type("witchcraft:potion_jump_lvx", 10, user)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_redbrown", {
- description = "Thick Potion",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_redbrown.png"},
- wield_image = "witchcraft_potion_redbrown.png",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_redbrown.png",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- local breath_change = user:set_breath(5)
- playereffects.apply_effect_type("witchcraft:potion_slow_lv1", 11, user)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_redbrown_2", {
- description = "Thick Potion (lv2)",
- drawtype = "plantlike",
- tiles = {"witchcraft_potion_redbrown.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_redbrown.png^[colorize:black:50",
- paramtype = "light",
- stack_max = 1,
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_redbrown.png^[colorize:black:50",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- local breath_change = user:set_breath(5)
- playereffects.apply_effect_type("witchcraft:potion_slow_lv2", 15, user)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_blue2", {
- description = "Watery Potion",
- drawtype = "plantlike",
- stack_max = 1,
- tiles = {"witchcraft_potion_blue2.png"},
- wield_image = "witchcraft_potion_blue2.png",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_blue2.png",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- local breath = user:get_breath()
- if breath <= 10 then
- playereffects.apply_effect_type("witchcraft:potion_swim_lv1", 15, user)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- end
- })
- minetest.register_node("witchcraft:potion_blue2_2", {
- description = "Watery Potion (lv2)",
- drawtype = "plantlike",
- stack_max = 1,
- tiles = {"witchcraft_potion_blue2.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_blue2.png^[colorize:black:50",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_blue2.png^[colorize:black:50",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- local breath = user:get_breath()
- if breath <= 10 then
- playereffects.apply_effect_type("witchcraft:potion_swim_lv2", 15, user)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- end
- })
- --light potion
- function lightchange(person, duration)
- local mtime = minetest.get_timeofday()
- if mtime <= 0.25 or mtime >= 0.75 then
- person:override_day_night_ratio(mtime+0.5)
- minetest.after(duration, function()
- person:override_day_night_ratio(nil)
- end)
- end
- end
- minetest.register_node("witchcraft:potion_yellow", {
- description = "Shiny Potion",
- drawtype = "plantlike",
- stack_max = 1,
- tiles = {"witchcraft_potion_yellow.png"},
- wield_image = "witchcraft_potion_yellow.png",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_yellow.png",
- on_use = function(item, user, pointed_thing)
- local player = user:get_player_name()
- lightchange(user, 10)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- minetest.register_node("witchcraft:potion_yellow_2", {
- description = "Shiny Potion (lv2)",
- drawtype = "plantlike",
- stack_max = 1,
- tiles = {"witchcraft_potion_yellow.png^[colorize:black:50"},
- wield_image = "witchcraft_potion_yellow.png^[colorize:black:50",
- paramtype = "light",
- is_ground_content = false,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
- },
- groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
- sounds = default.node_sound_glass_defaults(),
- inventory_image = "witchcraft_potion_yellow.png^[colorize:black:50",
- on_use = function(item, user, pointed_thing)
- lightchange(user, 20)
- local playerpos = user:getpos();
- minetest.add_particlespawner(
- 5, --amount
- 0.1, --time
- {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos
- {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=4,z=-0.5}, --minacc
- {x=0.5,y=4,z=0.5}, --maxacc
- 0.5, --minexptime
- 1, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png" --texture
- )
- item:replace("vessels:glass_bottle")
- return item
- end
- })
- --invisibility potion by Tenplus1(DWTFYWT V2), see darkpurple potion for on_use effect
- invisibility = {}
- -- reset player invisibility if they go offline
- minetest.register_on_leaveplayer(function(player)
- local name = player:get_player_name()
- if invisibility[name] then
- invisibility[name] = nil
- end
- end)
- invisible = function(player, toggle)
- if not player then return false end
- local name = player:get_player_name()
- invisibility[name] = toggle
- local prop
- if toggle == true then
- -- hide player and name tag
- prop = {
- visual_size = {x = 0, y = 0},
- collisionbox = {0, 0, 0, 0, 0, 0}
- }
- player:set_nametag_attributes({
- color = {a = 0, r = 255, g = 255, b = 255}
- })
- else
- -- show player and tag
- prop = {
- visual_size = {x = 1, y = 1},
- collisionbox = {-0.35, -1, -0.35, 0.35, 1, 0.35}
- }
- player:set_nametag_attributes({
- color = {a = 255, r = 255, g = 255, b = 255}
- })
- end
- player:set_properties(prop)
- end
- --decorative nodes
- minetest.register_node("witchcraft:mortar", {
- description = "mortar and pestle",
- tiles = {
- "default_stone.png",
- "default_stone.png",
- "default_stone.png",
- "default_stone.png",
- "default_stone.png",
- "default_stone.png"
- },
- drawtype = "nodebox",
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.25, -0.5, -0.25, 0.25, -0.4375, 0.25}, -- NodeBox1
- {-0.1875, -0.4375, -0.1875, 0.1875, -0.375, 0.1875}, -- NodeBox2
- {-0.3125, -0.375, -0.3125, -0.1875, 0.125, 0.3125}, -- NodeBox3
- {0.1875, -0.375, -0.3125, 0.3125, 0.125, 0.3125}, -- NodeBox4
- {-0.3125, -0.375, -0.3125, 0.3125, 0.125, -0.1875}, -- NodeBox5
- {-0.3125, -0.375, 0.1875, 0.3125, 0.125, 0.3125}, -- NodeBox6
- {-0.1875, -0.375, -0.1875, 0.25, -0.0625, 0.1875}, -- NodeBox7
- {-0.3125, -0.5, -0.5, 0.3125, -0.375, -0.375}, -- NodeBox8
- }
- },
- groups = {cracky=1, oddly_breakable_by_hand=1}
- })
- minetest.register_node("witchcraft:pentablock", {
- description = "Pentagram block",
- tiles = {
- "witchcraft_pentablock.png",
- },
- groups = {cracky=1, oddly_breakable_by_hand=1}
- })
- minetest.register_node("witchcraft:pentagram", {
- description = "pentagram",
- drawtype = "signlike",
- visual_scale = 3.0,
- tiles = {"witchcraft_pentagram.png"},
- inventory_image = "witchcraft_pentagram.png",
- use_texture_alpha = true,
- paramtype = "light",
- paramtype2 = "wallmounted",
- sunlight_propagates = false,
- light_source = 14,
- walkable = false,
- is_ground_content = true,
- selection_box = {
- type = "wallmounted",
- fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}
- },
- on_rightclick = function(pos, node, _)
- if minetest.get_modpath("mobs") then
- minetest.after(0.5, function()
- minetest.set_node(pos, {name="witchcraft:portal", param2=node.param2})
- minetest.add_particlespawner(
- 25, --amount
- 1, --time
- {x=pos.x-1, y=pos.y, z=pos.z-1}, --minpos
- {x=pos.x+1, y=pos.y, z=pos.z+1}, --maxpos
- {x=-0, y=-0, z=-0}, --minvel
- {x=0, y=0, z=0}, --maxvel
- {x=-0.5,y=1,z=-0.5}, --minacc
- {x=0.5,y=1,z=0.5}, --maxacc
- 1, --minexptime
- 1.5, --maxexptime
- 1, --minsize
- 2, --maxsize
- false, --collisiondetection
- "witchcraft_effect.png^[colorize:green:400" --texture
- )
- end)
- end
- end,
- groups = {cracky=3,dig_immediate=3},
- })
- minetest.register_node("witchcraft:portal", {
- description = "portal",
- drawtype = "signlike",
- visual_scale = 3.0,
- tiles = {"witchcraft_portal.png"},
- inventory_image = "witchcraft_portal.png",
- use_texture_alpha = true,
- paramtype = "light",
- paramtype2 = "wallmounted",
- sunlight_propagates = false,
- light_source = 14,
- walkable = false,
- is_ground_content = true,
- selection_box = {
- type = "wallmounted",
- fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}
- },
- on_construct = function(pos, node, _)
- minetest.after(1, function()
- if minetest.get_modpath("horror") then
- minetest.env:add_entity(pos, "horror:werewolf")
- elseif minetest.get_modpath("dmobs") then
- minetest.env:add_entity(pos, "dmobs:owl")
- elseif minetest.get_modpath("mobs_animal") then
- minetest.env:add_entity(pos, "mobs_animal:kitten")
- elseif minetest.get_modpath("mobs_monster") then
- minetest.env:add_entity(pos, "mobs_monster:oerkki")
- elseif minetest.get_modpath("pmobs") then
- minetest.env:add_entity(pos, "pmobs:wolf")
- end
- minetest.remove_node(pos)
- end)
- end,
- groups = {cracky=3,dig_immediate=3, not_in_creative_inventory=1},
- })
- minetest.register_node("witchcraft:candle", {
- description = "red candle",
- tiles = {
- "witchcraft_candle_top.png",
- "witchcraft_candle_top.png",
- "witchcraft_candle.png",
- "witchcraft_candle.png",
- "witchcraft_candle.png",
- "witchcraft_candle.png"
- },
- drawtype = "nodebox",
- paramtype = "light",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.1875, -0.5, -0.1875, 0.1875, -0.0625, 0.1875}, -- NodeBox1
- {-0.03125, -0.5, -0.03125, 0.03125, 0.0625, 0.03125}, -- NodeBox2
- }
- },
- groups = {fleshy=1, oddly_breakable_by_hand=1, dig_immediate=3},
- })
- --other stuff
- dofile(minetest.get_modpath("witchcraft").."/scrolls.lua")
- dofile(minetest.get_modpath("witchcraft").."/plants.lua")
- dofile(minetest.get_modpath("witchcraft").."/brewing_stand.lua")
- if minetest.get_modpath("hunger_ng") then
- dofile(minetest.get_modpath("witchcraft").."/opt/hunger_ng.lua")
- end
- if minetest.get_modpath("lightning") then
- dofile(minetest.get_modpath("witchcraft").."/opt/lightning.lua")
- end
|