Hidden Skills Scroll

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
TheMormegil
Adept
Posts: 213
Joined: Thu Apr 10, 2003 10:23 am
Location: Wales

Post by TheMormegil »

Would it be (/is it currently) possible to have say, a hidden skills scroll.
When viewed by a character it's text showing that characters hidden skillz0rs.
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

you mean, when a character read a special scroll, he is able to cast a spell that was forbidden before?
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Post by Joramun »

No, reading a special scroll that displays the luck, and other hidden attributes of the character.
What Is Your Quest ?
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

This is just a quick hack, I'm sure it could be done better.
However, as a demonstration, here's a scroll to display someone's hidden wizard skills on a scroll, using a subrenderer.

Code: Select all

obj.skillscroll = {
	name="SCROLL",
	type="THING",
	class="SCROLL",
	mass=1,
	icon=gfx.icons[31],
	alt_icon=gfx.icons[30],
	dungeon=gfx.scroll,
	to_r_hand = alticon,
	from_r_hand = normicon,
	fit_chest=true
}

function obj.skillscroll:subrenderer(id)
	local ch, who = dsb_get_coords(id)
	if (ch == MOUSE_HAND) then
		who = dsb_ppos_char(dsb_get_leader())
	end
	
	local names = { "FUL", "IR", "DES", "VEN" }
	local lines = { "SCROLL OF", "WIZARDRY", "" }
	for i=1,4 do
		local skillnum = dsb_xp_level(who, CLASS_WIZARD, i)
		local s_skill
		if (skillnum == 0) then
			s_skill = "NO SKILL IN " .. names[i]
		else
			s_skill = names[i] .. " " .. xp_levelnames[skillnum] 
		end
		
		lines[3+i] = s_skill
	end
	local num_lines = 7
	
	local y_base = 72 - (num_lines*7) + (num_lines % 2)	
    local sr = dsb_subrenderer_target()
	dsb_bitmap_blit(gfx.scroll_inside, sr, 0, 0, 0, 0, 246, 146)
	for i=1,num_lines do
	    dsb_bitmap_textout(sr, gfx.scroll_font, lines[i],
			124, y_base+((i-1)*14), CENTER, scroll_color)
	end	
end
(Note: What Adamo was talking about is also pretty easily doable, by adding an on_look event to the scroll)
User avatar
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Post by Joramun »

That just rocks. But I'm not too confident about how to design events attached to items, right now...
What Is Your Quest ?
Post Reply