Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > Star Wolves

Star Wolves 3D space RPG with deep strategy and tactical elements

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 08-03-2010, 03:42 PM
Aleksandar Aleksandar is offline
Registered Member
 
Join Date: Aug 2010
Posts: 10
Default

Quote:
Originally Posted by Trucidation View Post
Haha, edited while edited. Thanks, looks like I got it.

Hmm, it looks like { exp cost, { pre-req1, pre-req2, ... }, { choose one of these1, choose one of these2 }.

The third {} appears to be used only by the gun specialisations (choose HC / AC / Laser). I wonder if we can put other perks in here as well. E.g. choose between Criticals_1 or Hard_to_Kill.
Put it here for reference. Also, proposing a fix to the CanAddProperty function below
Code:
function CanAddProperty-Shark(pilot, property)

	if property == nil then
			return 0;
	else
		local nPrereqs = getn(property[2]);
		local nDenials = getn(property[3]);
		local prop_ = property[2];
		local deny_ = property[3];-
	
		local prereqsMet = FALSE;
		local deniesMet = FALSE;
		local i = 1;
	
		if(nPrereqs > 0) then
			if(pilot:HasProperty(prop_[1])) then 
				prereqsMet = TRUE;
				i = i+1;
			elseif
				return FALSE; --no prereq met
			end;

	-- Retrieved the first prereq flag. Collate with others and return

			while ((i <= nPrereqs) and (prereqsMet ~= FALSE)) do
				prereqsMet = prereqsMet and (pilot:HasProperty(prop_[i]));
			end;
		end;
	
	--Prereqs calculated, check for denies

		if(nDenials > 0) then
		--restart the counter
			i = 1;
			while ((i < nDenials) and (deniesMet ~= TRUE)) do
				deniesMet = deniesMet or (pilot:HasProperty(prop_[i]));
			end;
		end;

	--Denies calculated; return prereqsMet && !deniesMet
	
	return (prereqsMet and (not deniesMet));

	end; --property not nil
end; --eof
Feel free to correct my syntax errors, I'm still new at this language... spent about 10 mins viewing the game's scripts and I'm already making improvements... I need to get a grasp on language constructors and keywords. So far I've noticed I can do for, foreach and while - quite enough to build up anything more serious if there's a need. The lists help too, so if a need arises for a HashMap, I'll hash one out (hehe) for you.

Btw, I'm Aleksandar, a math/IT/AI graduate. Not much of a Touhou fan, but I adore bullethell shmups.

Last edited by Aleksandar; 08-03-2010 at 03:53 PM.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:44 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.