sorcery  Check-in [a08f21c56c]

Overview
Comment:look i don't fucking remember okay
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a08f21c56c00148cff83a118fe0525e114e36fd7c90dd5456bdfdb8423f7ba1e
User & Date: lexi on 2021-06-23 09:31:24
Other Links: manifest | tags
Context
2021-06-24
07:15
add basic keg impl check-in: 9b8118877e user: lexi tags: trunk
2021-06-23
09:31
look i don't fucking remember okay check-in: a08f21c56c user: lexi tags: trunk
2021-04-21
01:32
ui tweaks, rework enchantment slightly check-in: 41fdb5b0b8 user: lexi tags: trunk
Changes

Modified data/compat.lua from [40f7d044df] to [e10c4cb361].

    70     70   		['default:stone_with_iron'   ] = { id = 'steel',   metal = true };-- :/
    71     71   		['default:stone_with_copper' ] = { id = 'copper',  metal = true };
    72     72   		['default:stone_with_tin'    ] = { id = 'tin',     metal = true };
    73     73   		['default:stone_with_gold'   ] = { id = 'gold',    metal = true };
    74     74   		['default:stone_with_mese'   ] = { id = 'mese',    gem = true };
    75     75   		['default:stone_with_diamond'] = { id = 'diamond', gem = true };
    76     76   	};
           77  +	residue = {
           78  +		['farming:hemp_oil'] = 'vessels:glass_bottle';
           79  +	};
    77     80   }

Modified data/oils.lua from [1e67dfd074] to [dff1ef8974].

    99     99   			'farming:peas';
   100    100   			'farming:peas';
   101    101   		};
   102    102   	};
   103    103   	luscious = {
   104    104   		color = {10,255,10};
   105    105   		mix = {
   106         -			'sorcery:extract_greengrass';
   107         -			'sorcery:extract_grape';
          106  +			'farming:hemp_oil';
          107  +			'farming:grapes';
          108  +			'farming:cocoa_beans';
   108    109   			'farming:cocoa_beans';
   109    110   			'farming:sugar';
   110    111   			'farming:sugar';
   111    112   		};
   112    113   	};
   113    114   	luck = {
   114    115   		color = {156,54,255};
   115    116   		style = 'sparkle';
   116    117   		mix = {
   117    118   			'sorcery:extract_marram';
   118    119   			'farming:hemp_leaf';
   119         -			'farming:hemp_oil';
   120    120   			'xdecor:honey';
   121    121   			'farming:salt';
   122    122   			'farming:salt';
   123    123   		};
   124    124   	};
   125    125   }

Modified data/runes.lua from [92db18c27d] to [b47d0e6fa4].

   898    898   									if sorcery.lib.node.is_clear(sum) then
   899    899   										vp[#vp+1] = sum
   900    900   									end
   901    901   								end
   902    902   								if #vp > 0 then npos=vp[math.random(#vp)] end
   903    903   							end
   904    904   							if npos then
   905         -								minetest.set_node(npos, minetest.get_node(ctx.target.under))
   906         -								if minetest.registered_nodes[ty].on_construct then
   907         -									minetest.registered_nodes[ty].on_construct(npos)
   908         -								end
          905  +								minetest.place_node(npos, minetest.get_node(ctx.target.under))
          906  +								-- if minetest.registered_nodes[ty].on_construct then
          907  +								-- 	minetest.registered_nodes[ty].on_construct(npos)
          908  +								-- end
   909    909   								minetest.get_meta(npos):from_table(origmeta)
   910    910   								return npos, true
   911    911   							else
   912    912   								local nstack = ItemStack(ty)
   913    913   								nstack:get_meta():from_table(origmeta)
   914    914   								local leftover = ctx.caster:get_inventory():add_item('main',nstack)
   915    915   								if leftover and not leftover.is_empty() then
................................................................................
   988    988   			};
   989    989   		};
   990    990   	};
   991    991   	luminate = {
   992    992   		name = 'Luminate';
   993    993   		tone = {255,194,0};
   994    994   		minpower = 1;
   995         -		rarity = 5;
          995  +		rarity = 8;
   996    996   		amulets = {
   997    997   			luxite = {
   998    998   				name = 'Glow';
   999    999   				desc = 'Swathe yourself in an aura of sparkling radiance, casting light upon all the dark places where you voyage';
  1000   1000   				cast = function(ctx)
  1001   1001   					local fac = (ctx.stats.power * 0.1)
  1002   1002   					local radius = 2 + 5*fac
................................................................................
  1013   1013   								if sorcery.lib.str.beginswith(minetest.get_node(n).name,'sorcery:air_glimmer_') then
  1014   1014   									minetest.remove_node(n)
  1015   1015   								end
  1016   1016   							end
  1017   1017   						end;
  1018   1018   						intervals = {
  1019   1019   							{period = period, after = {whence=0,secs=0.7}, fn = function(c)
  1020         -								print('cycling!')
  1021   1020   								for _,sub in pairs(c.spell.subjects) do
  1022   1021   									local ox, oy, oz = math.random(-radius,radius),
  1023   1022   													   math.random(-radius,radius),
  1024   1023   													   math.random(-radius,radius)
  1025   1024   									local pos = vector.offset(sub.player:get_pos(), ox,oy,oz)
  1026         -									print('pos',minetest.pos_to_string(pos),'player',minetest.pos_to_string(sub.player:get_pos()))
         1025  +									-- print('pos',minetest.pos_to_string(pos),'player',minetest.pos_to_string(sub.player:get_pos()))
  1027   1026   									if sorcery.lib.node.is_air(pos) then
  1028         -										print('is air!')
  1029   1027   										local power = math.random(4,minetest.LIGHT_MAX)
  1030   1028   										minetest.set_node(pos, {
  1031   1029   											name = 'sorcery:air_glimmer_' .. tostring(power);
  1032   1030   										})
  1033   1031   										c.spell.nodes[#c.spell.nodes + 1] = pos
  1034   1032   										local d = glowduration * (0.5 + math.random()*0.5)
  1035   1033   										local m = minetest.get_meta(pos)
  1036   1034   										m:set_float('duration', d)
  1037   1035   										m:set_float('timeleft', d)
  1038   1036   										m:set_int('power', power)
  1039         -									else
  1040         -										print('not air!', dump(minetest.get_node(pos)))
         1037  +									-- else
         1038  +									-- 	print('not air!', dump(minetest.get_node(pos)))
  1041   1039   									end
  1042   1040   								end
  1043   1041   							end};
  1044   1042   						};
  1045   1043   					}
  1046   1044   				end;
  1047   1045   				iridium = {

Modified enchanter.lua from [5ad2e81269] to [9c51c1ba24].

   170    170   	end
   171    171   	sorcery.enchant.strength = function(stack,id)
   172    172   		-- this functions should be used whenever you need to
   173    173   		-- determine the power of a particular enchantment on
   174    174   		-- an enchanted item.
   175    175   		local e = sorcery.enchant.get(stack)
   176    176   		local p = 0.0
          177  +		local ct = 0
   177    178   		local slots = sorcery.matreg.lookup[stack:get_name()].data.slots
   178    179   		-- TODO handle strength-boosting spells!
   179    180   		for _,s in pairs(e.spells) do
   180         -			if s.id == id then p = p + ((s.boost * slots[s.slot].confluence)/10) end
          181  +			if s.id == id then
          182  +				p = p + ((s.boost * slots[s.slot].confluence)/10)
          183  +				ct = ct + 1
          184  +			end
   181    185   		end
   182         -		return p
          186  +		return p, ct
   183    187   	end
   184    188   	sorcery.enchant.stackup = function(stack)
   185    189   		-- stack update function. this should be called whenever
   186    190   		-- the enchantment status of a stack changes; it will
   187    191   		-- alter/reset tool capabilities and tooltip as necessary
   188    192   		local e = sorcery.enchant.get(stack)
   189    193   		local meta = stack:get_meta()
................................................................................
   423    427   	local material = sorcery.enchant.getsubj(tool)
   424    428   	local totalcost = 0
   425    429   	do local done = {} for _,sp in pairs(ench.spells) do
   426    430   		if done[sp.id] then goto skip end
   427    431   		done[sp.id] = true
   428    432   
   429    433   		local data = sorcery.data.enchants[sp.id]
   430         -		local strength = sorcery.enchant.strength(tool,sp.id)
          434  +		local strength, nsp = sorcery.enchant.strength(tool,sp.id)
   431    435   		local ch = math.random(1,100)
   432    436   		local props = {
   433    437   			fail = ch > sp.reliability;
   434    438   			user = puncher;
   435    439   			pos = pos;
   436    440   			node = node;
   437    441   			tool = tool;
................................................................................
   439    443   			enchantment = ench;
   440    444   			power = strength;
   441    445   			spell = sp;
   442    446   			sparks = sparks;
   443    447   			cost = data.cost;
   444    448   		} 
   445    449   		if data.on_dig then data.on_dig(props) end
   446         -		if props.cost ~= 0 then totalcost = totalcost + math.max(1,math.floor(props.cost * strength)) end
          450  +		if props.cost ~= 0 then totalcost = totalcost + math.max(1,props.cost * nsp) --[[math.max(1,math.floor(props.cost * strength))]] end
          451  +		-- strength does not increase cost but number of spell slots occupied does -- incentive for the player to be more clever, less brute-force-y
   447    452   
   448    453   		if ch > sp.reliability then goto skip end
   449    454   		sparks[#sparks + 1] = {
   450    455   			color = sorcery.lib.color(data.tone):brighten(1.1);
   451         -			count = strength * 7;
          456  +			count = strength * 8;
   452    457   		}
   453    458   	::skip::end end
   454    459   	if totalcost > 0 then
   455    460   		local conservation = math.floor(sorcery.enchant.strength(tool,'conserve') * 6)
   456    461   		-- totalcost = totalcost - (totalcost * conservation)
   457    462   		if conservation == 0 or math.random(conservation) == 1 then
   458    463   			ench.energy = math.max(0,ench.energy - (totalcost - (material.data.energysource or 0)))
................................................................................
   483    488   				};
   484    489   				velocity = {
   485    490   					x = range(-1.3,1.3);
   486    491   					z = range(-1.3,1.3);
   487    492   					y = range( 0.3,0.9);
   488    493   				};
   489    494   				expirationtime = life;
   490         -				size = range(0.5,1.5);
          495  +				size = range(0.2,1.5);
   491    496   				texture = sorcery.lib.image('sorcery_spark.png'):multiply(s.color):render();
   492    497   				glow = 14;
   493    498   				animation = {
   494    499   					type = "vertical_frames";
   495    500   					aspect_w = 16;
   496    501   					aspect_h = 16;
   497    502   					length = life + 0.1;

Modified potions.lua from [2e6379fa76] to [0b5549f5e7].

     1      1   local u = sorcery.lib
     2      2   sorcery.registry.mk('infusions',false)
     3      3   sorcery.registry.mk('residue',false)
            4  +sorcery.register.residue.meld(sorcery.data.compat.residue)
     4      5   
     5      6   sorcery.register_potion_tbl = function(tbl) -- :/
     6      7   	return sorcery.register_potion(tbl.name,tbl.label,tbl.desc,tbl.color,tbl.imgvariant,tbl.glow,tbl.extra)
     7      8   end
     8      9   sorcery.register_potion = function(name,label,desc,color,imgvariant,glow,extra)
     9     10   	local image = 'sorcery_liquid_'..(imgvariant or 'dull')..'.png' .. 
    10     11   		'^[multiply:'..tostring(color)..

Modified registration.lua from [d98f045dad] to [8bf4e2559c].

    64     64   		end
    65     65   		db[key] = value
    66     66   		for id in pairs(dat.iters) do 
    67     67   			reg.invoke(id,key)
    68     68   		end
    69     69   	end
    70     70   	reg.meld = function(tbl)
    71         -		for k,v in pairs(tbl) do reg.add(k,v) end
           71  +		for k,v in pairs(tbl) do reg.link(k,v) end
    72     72   	end
    73     73   	sorcery.register[name] = reg
    74     74   
    75     75   	local nextfn = sorcery.registry.defercheck
    76     76   	sorcery.registry.defercheck = function()
    77     77   		if #dat.defer ~= 0 then
    78     78   			print('WARNING: ' .. tostring(#dat.defer) .. ' deferred iterator(s) have not yet been discharged for registry “' .. name .. '”')

Modified vfx.lua from [d0158e43bb] to [8567a33693].

   116    116   sorcery.vfx.imbue = function(color, target, strength, height)
   117    117   	local tpos if target.get_pos then
   118    118   		tpos = target:get_pos()
   119    119   		if target.get_properties then
   120    120   			height = height or ((target:get_properties().eye_height or 1)*1.3)
   121    121   		end
   122    122   	else
   123         -		tpos = target
          123  +		tpos = vector.offset(target, 0,0.5,0)
   124    124   	end
   125    125   	height = height or 1
   126    126   	local scenter = vector.add(tpos, {x=0,y=height/2,z=0})
   127         -	for i=1,math.random(64*(strength or 1),128*(strength or 1)) do
          127  +	for i=1,math.random(24*(strength or 1),32*(strength or 1)) do
   128    128   		local high = (height+0.8)*math.random() - 0.8
   129    129   		local far = (high >= -0.5 and high <= height) and
   130    130   			(math.random() * 0.3 + 0.4) or
   131    131   			(math.random() * 0.5)
   132    132   		local yaw = {x=0, y = math.random()*(2*math.pi), z=0}
   133    133   		local po = vector.rotate({x=far,y=high,z=0}, yaw)
   134    134   		local ppos = vector.add(po,tpos)