sorcery  Diff

Differences From Artifact [9c44805455]:

  • File entities.lua — part of check-in [ea6e475e44] at 2020-10-19 09:52:11 on branch trunk — continue dev on celestial mechanics, add melding+division spells (resonance), refine itemclasses, add keypunch and punchcards, add paper pulp, add a shitload of visuals, add convenience scripts for working with the wiki, make the flamebolt spell actually useful instead of just a pretty lightshow, add essences, inferno crystal, and other goodies; iterate on wands, lots of shit i can't remember, various bugfixes (user: lexi, size: 3718) [annotate] [blame] [check-ins using]

To Artifact [2261aac8b4]:


     7      7   minetest.register_entity('sorcery:spell_projectile_flamebolt',{
     8      8   	initial_properties = {
     9      9   		visual = "sprite";
    10     10           -- use_texture_alpha = true;
    11     11   		textures = {'sorcery_fireball.png'};
    12     12   		groups = {immortal = 1};
    13     13   		visual_size = { x = 2, y = 2, z = 2 };
    14         -		physical = false;
    15         -		collide_with_objects = false;
           14  +		physical = true;
           15  +		collide_with_objects = true;
    16     16   		pointable = false;
    17     17   		glow = 14;
    18     18   		static_save = false;
    19     19   	};
    20     20   	on_step = function(self,dtime,collision)
    21     21   		local pos = self.object:get_pos()
    22     22   		if not self._meta then
................................................................................
    63     63   			spawn(250,  4.0,9,   0.3, 0.8,  3.0,  7.0)
    64     64   			spawn(500,  10,20,   1.0, 1.8,  2.0,  0.2)
    65     65   			spawn(500,  10,20,   0.5, 1.0,  3.0,  0.5)
    66     66   		end
    67     67   
    68     68   		::collcheck:: do
    69     69   			-- if no collision then return end
    70         -			local nname = minetest.get_node(pos).name 
    71         -			if nname == 'air' or minetest.registered_nodes[nname].walkable ~= true then return
    72         -			elseif nname == 'ignore' then goto destroy end
           70  +			-- local nname = minetest.get_node(pos).name 
           71  +			-- if nname == 'air' or minetest.registered_nodes[nname].walkable ~= true then return
           72  +			-- elseif nname == 'ignore' then goto destroy end
    73     73   			-- else fall through to explode
           74  +			if collision then -- since 5.3 only!!
           75  +				print('collision detected!',dump(collision))
           76  +				if collision.collides == false then return end
           77  +				if #collision.collisions > 0 then
           78  +					local col = collision.collisions[1]
           79  +					if col.node_pos then
           80  +						pos = col.node_pos
           81  +					elseif col.object then
           82  +						pos = col.object:get_pos()
           83  +					end
           84  +					-- fall through to explode
           85  +				else return end
           86  +			else return end
    74     87   		end
    75     88   
    76     89   		::explode:: do
    77     90   			-- minetest.add_particle({
    78     91   			-- 	pos = pos,
    79     92   			-- 	velocity     = { x = 0, y = 0, z = 0 };
    80     93   			-- 	acceleration = { x = 0, y = 0, z = 0 };