sorcery  Check-in [de7d27795b]

Overview
Comment:remove debug statements >_<
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: de7d27795bcc95c2f2747ec9e1d105fa30f15aa94be60446ba28e8348e726f04
User & Date: lexi on 2021-08-01 13:42:53
Other Links: manifest | tags
Context
2021-10-16
23:51
continue work on runes, comment out test code in vfx.lua check-in: 967d5006f5 user: lexi tags: trunk
2021-08-01
13:42
remove debug statements >_< check-in: de7d27795b user: lexi tags: trunk
2021-07-31
19:13
optimize pngs, finish spellshatter spell, tweak rune forge algorithm to be more fair & reasonable, new spell-casting vfx check-in: cb09c77754 user: lexi tags: trunk
Changes

Modified data/runes.lua from [4936c92bc2] to [00d856eebe].

   651    651   							local tex = sorcery.lib.image('sorcery_sputter.png'):glow(sorcery.lib.color(160,255,80)):render();
   652    652   							local epicenter = ctx.caster:get_pos() + vector.new(0, h/2, 0)
   653    653   							local maxima = vector.new(radius, radius, radius)
   654    654   							local potential_targets = minetest.find_nodes_in_area(epicenter - maxima, epicenter + maxima, {'group:sorcery_magical', 'group:sorcery_magitech'})
   655    655   							local wreck = {}
   656    656   							for _, pos in pairs(potential_targets) do
   657    657   								if sorcery.lib.math.vdcomp(radius,epicenter,pos) then
   658         -									print('got wreckable at',pos)
   659    658   									wreck[#wreck+1] = pos
   660    659   								end
   661    660   							end
   662    661   							sorcery.spell.cast {
   663    662   								name = 'sorcery:spellshatter';
   664    663   								caster = ctx.caster;
   665    664   								anchor = epicenter;
................................................................................
  1504   1503   							local put = function(ofs)
  1505   1504   								timeline[{whence=0,secs=per*i}] = function(s)
  1506   1505   									local p = vector.add(w,ofs)
  1507   1506   									if not sorcery.lib.node.is_clear(p) then return end
  1508   1507   									spark(s, p)
  1509   1508   									minetest.sound_play('sorcery_put', {pos = p, gain = 0.4}, true)
  1510   1509   									local lamp = mpick 'lamp_ext'
  1511         -									print('installing lamp',lamp,p,vector.new(ofs))
  1512   1510   									put_align(p, lamp, vector.multiply(ofs,-1))
  1513   1511   								end
  1514   1512   								i=i+1
  1515   1513   							end
  1516   1514   							put{x=o.x, y=0, z=0}
  1517   1515   							put{x=0,   y=0, z=o.z}
  1518   1516   						end

Modified runeforge.lua from [dd6f797d8b] to [fd9aa86a12].

   273    273   	if time and has_phial() and pow_min and not probe.disjunction then -- roll for runes
   274    274   		local phial = i:get_stack('phial',1)
   275    275   		local int, powerfac = calc_phial_props(phial)
   276    276   		local pf = phial:get_meta():get_int('force')
   277    277   		local rolls = math.floor(time/int)
   278    278   		local newrunes = {}
   279    279   		for _=1,rolls do
   280         -			print('--- rune roll',_,'pf',pf)
   281    280   			local choices = {}
   282    281   			for name,rune in pairs(sorcery.data.runes) do
   283    282   				local powreq = (rune.minpower*powerfac)*time 
   284         -				print('- rune', name)
   285         -				print('powreq',powreq)
   286         -				print('power draw',l.self.powerdraw)
   287    283   				if powreq <= l.self.powerdraw then
   288         -					print(' ! sufficient power for rune')
   289    284   					choices[#choices + 1] = rune
   290    285   				end
   291    286   			end
   292    287   			for k,v in pairs(choices) do print(' * choice',k,v.item) end
   293    288   			if #choices > 0 then
   294    289   				for try = 1,#choices do
   295         -					print(' -- try',try)
   296    290   					local _, choice = sorcery.lib.tbl.pick(choices)
   297    291   					local adjrare = math.max(2, choice.rarity - pf)
   298         -					print(choice.item,'rarity',choice.rarity, 'adjusted', adjrare)
   299    292   					if math.random(adjrare) == 1 then
   300         -						print(' ! picking ', choice.item)
   301    293   						newrunes[#newrunes + 1] = ItemStack(choice.item)
   302    294   						break
   303    295   					end
   304    296   				end
   305    297   			end
   306    298   			-- print('rune choices:',dump(choices))
   307    299   			-- print('me',dump(l.self))