Moon and Star pairing

All new ideas for the upcoming releases of ToME 4.x.x should be discussed here

Moderator: Moderator

Message
Author
yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Moon and Star pairing

#1 Post by yufra »

I know FinalMaster has been working on this for the past few days, and after a bit of poking and prodding I got this together. I don't know exactly what bonuses he wanted to add so I added lite (a total of 2), blind and 10% increased darkness damage to Moon, and confusion and 10% increased light damage to Star. If you want to tweak it change the activate_pair function. Cheers!

Code: Select all

local activate_pair = function(moon, star, who)
	local DamageType = require "engine.DamageType"
	moon.paired = {}
	star.paired = {}
	-- The Moon knife's bonuses
	moon.paired._special1 = {"lite", who:addTemporaryValue("lite", 1)}
	moon.paired._special2 = {"melee_project", who:addTemporaryValue("melee_project", {[DamageType.BLINDPHYSICAL]=2})}
	moon.paired._special3 = {"inc_damage", who:addTemporaryValue("inc_damage", {[DamageType.DARKNESS]=10}) }
	-- The Star knife's bonuses
	star.paired._special1 = {"lite", who:addTemporaryValue("lite", 1)}
	star.paired._special2 = {"melee_project", who:addTemporaryValue("melee_project", {[DamageType.CONFUSION]=25})}
	star.paired._special3 = {"inc_damage", who:addTemporaryValue("inc_damage", {[DamageType.LIGHT]=10}) }
	game.log("The two blades glow brightly as they are brought close together.")
end

local deactivate_pair = function(moon, star, who)
	-- Remove the paired bonuses
	for k, id in pairs(moon.paired) do
		if type(id) == "table" then
			who:removeTemporaryValue(id[1], id[2])
		else
			who:removeTemporaryValue(k, id)
		end
	end
	for k, id in pairs(star.paired) do
		if type(id) == "table" then
			who:removeTemporaryValue(id[1], id[2])
		else
			who:removeTemporaryValue(k, id)
		end
	end
	moon.paired = nil
	star.paired = nil
	game.log("The light from the two blades fades as they are separated.")
end

newEntity{ base = "BASE_KNIFE",
	unique = true,
	name = "Moon",
	define_as = "MOON",
	unided_name = "crescent blade",
	desc = [[A viciously curved blade that devours the light around it.]],
	level_range = {20, 30},
	rarity = 200,
	require = { stat = { dex=28, cun=20 }, },
	cost = 300,
	material_level = 3,
	combat = {
		dam = 24,
		apr = 15,
		physcrit = 5,
		dammod = {dex=0.45,str=0.45},
		melee_project={[DamageType.DARKNESS] = 20},
	},
	wielder = {
		lite = -1,
		inc_damage={
			[DamageType.DARKNESS] = 5,
		},
	},
	activate_pair = activate_pair,
	deactivate_pair = deactivate_pair,
	on_wear = function(self, who)
		-- Look for the Star knife
		local o, item, inven_id = who:findInAllInventoriesBy("define_as", "STAR")
		if o and who:getInven(inven_id).worn then
			self.activate_pair(self, o, who)
		end
	end,
	on_takeoff = function(self, who)
		if self.paired then
			local o, item, inven_id = who:findInAllInventoriesBy("define_as", "STAR")
			if o and who:getInven(inven_id).worn then
				self.deactivate_pair(self, o, who)
			end
		end
	end,
}

newEntity{ base = "BASE_KNIFE",
	unique = true,
	name = "Star",
	define_as = "STAR",
	unided_name = "jagged blade",
	desc = [[A bright blade with more teeth than the most savage troll.]],
	level_range = {20, 30},
	rarity = 200,
	require = { stat = { dex=20, cun=28 }, },
	cost = 300,
	material_level = 3,
	combat = {
		dam = 22,
		apr = 7,
		physcrit = 13,
		dammod = {dex=0.45,str=0.45},
		melee_project={[DamageType.LIGHT] = 20},
	},
	wielder = {
		lite = 1,
		inc_damage={
			[DamageType.LIGHT] = 5,
		},
	},
	activate_pair = activate_pair,
	deactivate_pair = deactivate_pair,
	on_wear = function(self, who)
		-- Look for the Moon knife
		local o, item, inven_id = who:findInAllInventoriesBy("define_as", "MOON")
		if o and who:getInven(inven_id).worn then
			self.activate_pair(o, self, who)
		end
	end,
	on_takeoff = function(self, who)
		if self.paired then
			local o, item, inven_id = who:findInAllInventoriesBy("define_as", "MOON")
			if o and who:getInven(inven_id).worn then
				self.deactivate_pair(o, self, who)
			end
		end
	end,
}
<DarkGod> lets say it's intended

marchewka
Thalore
Posts: 156
Joined: Thu Dec 30, 2010 9:52 am

Re: Moon and Star pairing

#2 Post by marchewka »

Awww dammit, and my rogue wielding moon+star died yesterday...
(poked his nose into the crypt for the first time)

coffee
Higher
Posts: 52
Joined: Tue Jan 04, 2011 11:10 am

Re: Moon and Star pairing

#3 Post by coffee »

I personally like much use double dagger style but I'm a bit disapointed since after add a lot of DEX stats and use good "unique" daggers like Moon/Star I still felt me like a bit underpowered so now I gave up and started to increase "STR" and use heavy weapons with good stats. At least STR can be used to inrease HP and carry more

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Moon and Star pairing

#4 Post by Grey »

yufra, just to check, does the getInven().worn function include checks of equipment in the swap slot?
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Moon and Star pairing

#5 Post by yufra »

marchewka and coffee: FinalMaster noted the same underwhelming nature of Moon and Star and set about pairing them, so be sure to thank him for the idea. :)

Grey: great suggestion! My first guess is yes it will (mistakenly) check the second set of weapons. I'll confirm and potentially fix this later. Cheers!

EDIT: I just checked and the secondary weapon slots are not marked as "worn", so the current code is fine in that regard.
Last edited by yufra on Fri Jan 07, 2011 4:51 pm, edited 1 time in total.
<DarkGod> lets say it's intended

coffee
Higher
Posts: 52
Joined: Tue Jan 04, 2011 11:10 am

Re: Moon and Star pairing

#6 Post by coffee »

yufra wrote:marchewka and coffee: FinalMaster noted the same underwhelming nature of Moon and Star and set about pairing them, so be sure to thank him for the idea. :)
I thank him right now, the Moon/Star set and usually Dex knive weapons are a lot underpowered. If daggers do less damage than any other weapons they have other compensations like extra stat features. Thanks for suggesting FinalMaster

BTW how about a summoner druid class wielding dual daggers/claws/sickes?

Final Master
Sher'Tul
Posts: 1022
Joined: Fri May 21, 2010 8:16 pm
Location: Inside the minds of all
Contact:

Re: Moon and Star pairing

#7 Post by Final Master »

This is what I have right now, but something is buggy. If I do a normal attack - then I only attack with my main hand. If I do an attack that is a talent, it only uses the off hand. Blind is happening but confuse isn't. The proper texts show in the character sheet and in the ingame log. All the numbers are correct. Talents that I attack with aren't going on cooldown though - like flurry, sweep, whirlwind.

Code: Select all

	-- The Twin blades Moon and Star
local activate_pair = function(moon, star, who)
   local DamageType = require "engine.DamageType"
   moon.paired = {}
   star.paired = {}
   -- The Moon knife's bonuses
   moon.paired._special1 = {"lite", who:addTemporaryValue("lite", 1)}
   moon.paired._special2 = {"melee_project", who:addTemporaryValue("melee_project", {[DamageType.CONFUSION]=25})}
   moon.paired._special3 = {"inc_damage", who:addTemporaryValue("inc_damage", {[DamageType.DARKNESS]=10}) }
   -- The Star knife's bonuses
   star.paired._special1 = {"lite", who:addTemporaryValue("lite", 1)}
   star.paired._special2 = {"melee_project", who:addTemporaryValue("melee_project", {[DamageType.BLINDPHYSICAL]=5})}
   star.paired._special3 = {"inc_damage", who:addTemporaryValue("inc_damage", {[DamageType.LIGHT]=10}) }
   game.log("The two blades glow brightly as they are brought close together.")
end

local deactivate_pair = function(moon, star, who)
   -- Remove the paired bonuses
   for k, id in pairs(moon.paired) do
      if type(id) == "table" then
         who:removeTemporaryValue(id[1], id[2])
      else
         who:removeTemporaryValue(k, id)
      end
   end
   for k, id in pairs(star.paired) do
      if type(id) == "table" then
         who:removeTemporaryValue(id[1], id[2])
      else
         who:removeTemporaryValue(k, id)
      end
   end
   moon.paired = nil
   star.paired = nil
   game.log("The light from the two blades fades as they are separated.")
end

newEntity{ base = "BASE_KNIFE",
   unique = true,
   name = "Moon",
   define_as = "MOON",
   unided_name = "crescent blade",
   desc = [[A viciously curved blade that a folk story says is made from a material that originates from the moon.  Devouring the light abound, it fades.]],
   level_range = {20, 30},
   rarity = 200,
   require = { stat = { dex=20, cun=20 }, },
   cost = 300,
   material_level = 3,
   combat = {
      dam = 30,
      apr = 30,
      physcrit = 10,
      dammod = {dex=0.45,cun=0.45},
      melee_project={[DamageType.DARKNESS] = 20},
   },
   wielder = {
      lite = -1,
      inc_damage={
         [DamageType.DARKNESS] = 10,
      },
   },
   activate_pair = activate_pair,
   deactivate_pair = deactivate_pair,
   on_wear = function(self, who)
      -- Look for the Star knife
      local o, item, inven_id = who:findInAllInventoriesBy("define_as", "STAR")
      if o and who:getInven(inven_id).worn then
         self.activate_pair(self, o, who)
      end
   end,
   on_takeoff = function(self, who)
      if self.paired then
         local o, item, inven_id = who:findInAllInventoriesBy("define_as", "STAR")
         if o and who:getInven(inven_id).worn then
            self.deactivate_pair(self, o, who)
         end
      end
   end,
}

newEntity{ base = "BASE_KNIFE",
   unique = true,
   name = "Star",
   define_as = "STAR",
   unided_name = "jagged blade",
    desc = [[Legend tells of a blade, shining bright as a star. Forged from a material fallen from the skies, it glows.]],
   level_range = {20, 30},
   rarity = 200,
   require = { stat = { dex=20, cun=20 }, },
   cost = 300,
   material_level = 3,
   combat = {
      dam = 25,
      apr = 20,
      physcrit = 20,
      dammod = {dex=0.45,cun=0.45},
      melee_project={[DamageType.LIGHT] = 20},
   },
   wielder = {
      lite = 1,
      inc_damage={
         [DamageType.LIGHT] = 10,
      },
   },
   activate_pair = activate_pair,
   deactivate_pair = deactivate_pair,
   on_wear = function(self, who)
      -- Look for the Moon knife
      local o, item, inven_id = who:findInAllInventoriesBy("define_as", "MOON")
      if o and who:getInven(inven_id).worn then
         self.activate_pair(o, self, who)
      end
   end,
   on_takeoff = function(self, who)
      if self.paired then
         local o, item, inven_id = who:findInAllInventoriesBy("define_as", "MOON")
         if o and who:getInven(inven_id).worn then
            self.deactivate_pair(o, self, who)
         end
      end
   end,
}
Final Master's Character Guides
Final Master's Guide to the Arena
Edge: Final Master... official Tome 4 (thread) necromancer.
Zonk: I'd rather be sick than on fire! :D

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Moon and Star pairing

#8 Post by yufra »

There is a bug in the CONFUSION code, and I am also looking at changing some of the T-Engine code to allow the confuse and blind damage types to be easily added to the respective daggers instead of the actor as a whole. Currently if either paired knife hits the target will have to save against blinding, and I think it should be limited to one knife. I'll wait to see if the T-Engine code changes before fixing Moon/Star.
<DarkGod> lets say it's intended

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Moon and Star pairing

#9 Post by yufra »

Depending on if my suggested refactor is accepted, this code will work below. Here the blind and confuse effects are moved to the specific weapons and will only fire if the specific weapon hits.

Code: Select all

	-- The Twin blades Moon and Star
local activate_pair = function(moon, star, who)
	local DamageType = require "engine.DamageType"
	moon.paired = {}
	star.paired = {}

	-- The Moon knife's bonuses
	moon.paired._special1 = {who, "lite", who:addTemporaryValue("lite", 1)}
	moon.paired._special2 = {moon, "combat", moon:addTemporaryValue("combat", {melee_project={[DamageType.BLINDPHYSICAL]=2}})}
	moon.paired._special3 = {who, {"inc_damage", DamageType.DARKNESS}, who:addTemporaryValue({"inc_damage", DamageType.DARKNESS}, 10)}
	-- The Star knife's bonuses
	star.paired._special1 = {who, "lite", who:addTemporaryValue("lite", 1)}
	star.paired._special2 = {star, "combat", star:addTemporaryValue("combat", {melee_project={[DamageType.RANDOM_CONFUSION]=2}})}
	star.paired._special3 = {who, "inc_damage", who:addTemporaryValue("inc_damage", {[DamageType.LIGHT]=10}) }
	game.log("The two blades glow brightly as they are brought close together.")
end

local deactivate_pair = function(moon, star, who)
	-- Remove the paired bonusese
	for k, id in pairs(moon.paired) do
		id[1]:removeTemporaryValue(id[2], id[3])
	end
	for k, id in pairs(star.paired) do
		id[1]:removeTemporaryValue(id[2], id[3])
	end
	moon.paired = nil
	star.paired = nil
	game.log("The light from the two blades fades as they are separated.")
end
<DarkGod> lets say it's intended

Final Master
Sher'Tul
Posts: 1022
Joined: Fri May 21, 2010 8:16 pm
Location: Inside the minds of all
Contact:

Re: Moon and Star pairing

#10 Post by Final Master »

I hope your code changes get accepted into the engine as that will open up a lot more possibilities for more truly fun and unique egos/artifacts. Especially with the ability to create a 'set' such as Moon/Star, and others. Thank you so much for all your help yuf, along with Pap, edge, DG, Zonk and a few others that I cannot recall currently.

I really want to make Star/Moon the first paired artifacts so that others can create their own set ideas using code similar to this, instead of going through all the hassle like I have.

Thanks again to everyone, and PLEASE add yuf's code suggestions. If nothing else, it'll be cool!
Final Master's Character Guides
Final Master's Guide to the Arena
Edge: Final Master... official Tome 4 (thread) necromancer.
Zonk: I'd rather be sick than on fire! :D

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Moon and Star pairing

#11 Post by Grey »

I've found the pair with an Anorithil, and was very keen to try it out, but alas the dex requirement is too prohibitive... Perhaps if I find some good dex-pumping equipment I'll give them a go. However I still don't see them rivalling a really good staff.

Perhaps we need a Night Ranger of sorts - a rogueish class with some of the darkness divine skills.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

Final Master
Sher'Tul
Posts: 1022
Joined: Fri May 21, 2010 8:16 pm
Location: Inside the minds of all
Contact:

Re: Moon and Star pairing

#12 Post by Final Master »

Anorthils only need Magic, Con and Cun - you can afford to drop 10 points or so into dex - they are very VERY worth it on an Anorthil.
Final Master's Character Guides
Final Master's Guide to the Arena
Edge: Final Master... official Tome 4 (thread) necromancer.
Zonk: I'd rather be sick than on fire! :D

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Moon and Star pairing

#13 Post by Grey »

I think they'll be more useful at high levels, so I'll hang on to them till then.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

shwqa
Halfling
Posts: 95
Joined: Fri Jan 07, 2011 8:49 am

Re: Moon and Star pairing

#14 Post by shwqa »

Grey wrote:I've found the pair with an Anorithil, and was very keen to try it out, but alas the dex requirement is too prohibitive... Perhaps if I find some good dex-pumping equipment I'll give them a go. However I still don't see them rivalling a really good staff.

Perhaps we need a Night Ranger of sorts - a rogueish class with some of the darkness divine skills.

This is a bit off topic but I'm still on the stance that the toles top staff (which is one handed) + lunar shield is the best combo for Anorithil. My Anorithil had it but it needs 35 strength and magic to pull off.

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Moon and Star pairing

#15 Post by Grey »

Looking at your char sheet.... yes, absolutely. Nothing else can compete with that.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

Post Reply