sorcery  Check-in [1276138728]

Overview
Comment:add Mundanity spell, bug fixes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 12761387289378fb3e619de47f34718225c34c7ec47a800d40bfd6a09c737b87
User & Date: lexi on 2021-07-05 00:59:06
Other Links: manifest | tags
Context
2021-07-05
01:02
remove debug statements durr check-in: 5fbd1ed57c user: lexi tags: trunk
00:59
add Mundanity spell, bug fixes check-in: 1276138728 user: lexi tags: trunk
2021-07-04
20:27
add cool and informative visuals for taps, add more capacity to rune forge, many bug fixes, fixed some bugs, and fixed some bugs check-in: 94064fe5c9 user: lexi tags: trunk
Changes

Modified data/runes.lua from [b47d0e6fa4] to [2dad4b5804].

   498    498   						};
   499    499   					}
   500    500   				end
   501    501   			};
   502    502   			diamond = {
   503    503   				name = 'Mundanity';
   504    504   				desc = 'Strip away the effects of all active potions and spells in your immediate vicinity, leaving adversaries without their magicks to enhance and protect them, and allies free of any curses they may be hobbled by -- and, of course, vice versa';
          505  +				cast = function(ctx)
          506  +					local where = ctx.caster:get_pos()
          507  +					local what = minetest.get_objects_inside_radius(where, 3 + (2*ctx.stats.power))
          508  +					local who = {}
          509  +					local pfac = math.min(1, ctx.stats.power/8)
          510  +					for _, w in pairs(what) do
          511  +						if w:is_player() and w ~= ctx.caster then
          512  +							who[#who+1] = {player = w}
          513  +						end
          514  +					end
          515  +					if not next(who) then return false end
          516  +
          517  +					local timeline = {}
          518  +					local casttime = 4 - (3 * pfac)
          519  +					local tf = casttime / #who
          520  +
          521  +					local h = ctx.heading.eyeheight*1.1
          522  +					sorcery.spell.cast {
          523  +						name = 'sorcery:mundanity';
          524  +						caster = ctx.caster;
          525  +						attach = 'caster';
          526  +						subjects = who;
          527  +						_aff_idx = 1;
          528  +						_ntgt = #who;
          529  +						duration = 3 + casttime;
          530  +						timeline = {
          531  +							[0] = function(s,te,tl)
          532  +								s.visual_caster {
          533  +									amount = 100 * s.duration, time = s.duration, glow = 14;
          534  +									texture = sorcery.lib.image('sorcery_sputter.png'):glow(sorcery.lib.color(160,255,80)):render();
          535  +									minpos = { x = -0.1, y = -0.5,z = -0.1 };
          536  +									maxpos = { x =  0.1, y =  h*0.5,z =  0.1 };
          537  +									minvel = { x = -0.0, y = -8.0, z = -0.0 };
          538  +									maxvel = { x =  0.0, y =  8.0, z =  0.0 };
          539  +									minacc = { x = -0.2, y = -0.0, z = -0.2 };
          540  +									maxacc = { x =  0.2, y = -0.2, z =  0.2 };
          541  +									minexptime = 3, maxexptime = 3;
          542  +									minsize = 0.2, maxsize = 3.5;
          543  +									animation = {
          544  +										type = 'vertical_frames', length = (21/6) + 0.1;
          545  +										aspect_w = 16, aspect_h = 16;
          546  +									}
          547  +								}
          548  +							end;
          549  +							[0.3] = function(s,te,tl)
          550  +								s.visual_caster {
          551  +									amount = 100 * s.duration, time = s.duration, glow = 14;
          552  +									texture = sorcery.lib.image('sorcery_sputter.png'):glow(sorcery.lib.color(160,255,80)):render();
          553  +									minpos = { x = -0.1, y =  3.0, z = -0.1 };
          554  +									maxpos = { x =  0.1, y =  3.2, z =  0.1 };
          555  +									minvel = { x = -5.0, y = -0.5, z = -5.0 };
          556  +									maxvel = { x =  5.0, y =  0.5, z =  5.0 };
          557  +									minacc = { x = -0.4, y =  1.0, z = -0.4 };
          558  +									maxacc = { x =  0.4, y = -1.0, z =  0.4 };
          559  +									minexptime = 6, maxexptime = 6;
          560  +									minsize = 0.2, maxsize = 1.4;
          561  +									animation = {
          562  +										type = 'vertical_frames', length = (21/24) + 0.1;
          563  +										aspect_w = 16, aspect_h = 16;
          564  +									};
          565  +								}
          566  +							end;
          567  +						};
          568  +						intervals = {
          569  +							{period = tf; after = {secs=1.2}; fn = function(c)
          570  +								print('---- aff idx is now', c.spell._aff_idx)
          571  +								print(dump(c.spell.subjects))
          572  +								local sub = c.spell.subjects[c.spell._aff_idx] 
          573  +								if sub then 
          574  +									print('  -- sub found')
          575  +									c.spell.visual {
          576  +										amount = 100, time = 2, glow = 14;
          577  +										attached = c.spell.subjects[c.spell._aff_idx].player;
          578  +										texture = sorcery.lib.image('sorcery_sputter.png'):glow(sorcery.lib.color(160,255,80)):render();
          579  +										minpos = { x = -0.3, y =  7.3, z = -0.3 };
          580  +										maxpos = { x =  0.3, y =  5.7, z =  0.3 };
          581  +										minvel = { x = -0.0, y = -7.5, z = -0.0 };
          582  +										maxvel = { x =  0.0, y = -8.5, z =  0.0 };
          583  +										minacc = { x = -0.4, y =  1.0, z = -0.4 };
          584  +										maxacc = { x =  0.4, y = -2.0, z =  0.4 };
          585  +										minexptime = 6, maxexptime = 6;
          586  +										minsize = 3, maxsize = 7;
          587  +										animation = {
          588  +											type = 'vertical_frames', length = (21/6) + 0.1;
          589  +											aspect_w = 16, aspect_h = 16;
          590  +										};
          591  +									}
          592  +									-- if c.spell._aff_idx > c.spell._ntgt then return false end
          593  +								end
          594  +							end};
          595  +							{period = tf; after = {secs=2.1}; fn = function(c)
          596  +								local sub = c.spell.subjects[c.spell._aff_idx] 
          597  +								if sub then purge(sub.player) end
          598  +								c.spell._aff_idx = c.spell._aff_idx + 1
          599  +								print('---> aff idx is now', c.spell._aff_idx)
          600  +								print(dump(c.spell.subjects))
          601  +								-- if c.spell._aff_idx > c.spell._ntgt then return false end
          602  +							end};
          603  +						};
          604  +					}
          605  +				end;
   505    606   				frame = {
   506    607   					iridium = {
   507    608   						name = 'Spellshatter';
   508    609   						desc = 'Blast out a tidal wave of anti-magic that will nullify active spells, but also disenchant or destroy all magical items in range of its violently mundane grip';
          610  +						cast = function(ctx)
          611  +							local where = ctx.caster:get_pos()
          612  +							local what = minetest.get_objects_inside_radius(where, 3 + (2*ctx.stats.power))
          613  +							local who = {}
          614  +							local pfac = math.min(1, ctx.stats.power/8)
          615  +							for _, w in pairs(what) do
          616  +								if w:is_player() and w ~= ctx.caster then
          617  +									who[#who+1] = {player = w}
          618  +								end
          619  +							end
          620  +							if not next(who) then return false end
          621  +						end;
   509    622   					};
   510    623   				};
   511    624   			};
   512    625   		}
   513    626   	};
   514    627   	repulse = {
   515    628   		name = 'Repulse';

Modified tap.lua from [9cfe073fce] to [de4da8497e].

    87     87   				tree = t
    88     88   				goto found
    89     89   			end
    90     90   		end do
    91     91   			return
    92     92   		end ::found::
    93     93   
    94         -		local tposhash = vector.to_string(tpos)
           94  +		local tposhash = minetest.hash_node_position(tpos)
    95     95   		local live, should_cache
    96     96   		local mass_leaves, mass_trunk, topnode, prevalidate
    97     97   		if abm_cache.treehash[tposhash] then
    98     98   			live = true
    99     99   			local c = abm_cache.treehash[tposhash]
   100    100   			mass_leaves = c.mass_leaves
   101    101   			mass_trunk = c.mass_trunk