ID:152010
 
Battle()
switch(input("What options",text)in list("Battle","Switch Characters")
if("Switch Characters")
var/pick = input("Which character",text)in src.party
if("Strong man")
src.strength = src.base_party_strength + 12
src.defense = src.base_party_defense - 3
src.health = src.base_party_health + 22
src.magic = src.base_party_magic - 38
if("Wizard")
src.strength = src.base_party_strength -5
src.defense = src.base_party_defense - 3
src.health = src.base_party_health + 2
src.magic = src.base_party_magic + 13
if("Knight")
src.strength = src.base_party_strength
src.defense = src.base_party_defense + 22
src.health = src.base_party_health + 39
src.magic = src.base_party_magic - 34

basically its based on the characters attributes and the basic party. like when the party levels up the base party variables rise and when summon the person equals the base party stats + their set stats so whenever they level up the base party attributes increase making it look like their stats increase individually as well(I know this could be much more complex but this is just a simpler idea)

Also which would i level up the base party attributes or the character attributes
stat += increase
Unless the party is always together, tying their stats together like this isn't such a great idea. Conferring some kind of bonus for the duration that they're in the party isn't bad, though, except that partying up has enough advantages you shouldn't need to worry about that.

I'd just use the good old experience system, but divvy up points. And I'd divvy them up unevenly in some cases, so if a level 1 goes questing with a level 10, he doesn't shoot up 3 levels at a time just because a 10 did all the work. There is however some point to the idea of learning by experience, so I wouldn't make it totally uneven.

/*
In this code, total_xp is the XP earned by the party. The party var
is a list of mobs in the party.
*/


var/total_theshold = 0
var/list/threshold = new
var/n = party.len
var/mob/M
for(M in party)
/*
We don't want a character gaining levels too quickly, so calculate a
piece of the pie for them. Their ideal pie piece should be 10% of what
they need to get from the current level's XP to the next. I.e. if you
need 20 XP total to get to level 2 and 60 to reach level 3, then the
ideal "cut" is +4 XP (10% of 40) for a level 2 character.
*/

threshold[M] = max(1, round((XPFormula(M.level + 1) - XPFormula(M.level)) / 10))
total_threshold += threshold[M]

/*
Small pie: Everyone's total cut is more than the group actually earned
on the kill(s). This is common unless fighting a boss or something. In
this case an even split is ideal, but if you're partying with a
low-level character, an even split may be bigger than the cut they
need. So take care of the smaller pie pieces first, and divvy up the
rest evenly.
*/

if(total_threshold > total_xp)
var/changed
do
changed = 0
/*
The even split is recalculated as we give out small pie pieces.
This helps because someone who wasn't considered a "small picee"
character before might be now. For instance if 32 XP have to be
shared and one of the four characters needs only 2 XP, an even
split would have been 8 XP per person. After handing out the 2 XP,
what's left is 30 XP split three ways, or 10 XP each. If another
guy in the party only needs 9 XP, he gets it right away.
*/

var/minxp = round(total_xp / n)
for(M in party)
if(threshold[M] <= minxp)
M.xp += threshold[M]
total_threshold -= threshold[M]
total_xp -= threshold[M]
M.Levelup()
threshold -= M
++changed
if(--n > 0) minxp = round(total_xp / n)
while(changed && n)

/*
Whatever's left of the pie, split evenly. Pick at random so that any
extra XP left off by rounding get distributed randomly.
*/

while(n)
var/minxp = round(total_xp / n)
M = pick(threshold)
M.xp += minxp
total_xp -= minxp
M.Levelup()
threshold -= M
--n
return

/*
Big pie: Everyone's ideal cut is actually small enough that there's
XP to spare, so supersize it: Give everyone a proportionally bigger
piece. Pick at random while calculating portions, so rounding errors
will be moot.
*/

while(n)
M = pick(threshold)
var/allotment = round(total_xp * threshold[M] / total_threshold)
M.xp += allotment
total_xp -= allotment
total_threshold -= threshold[M]
M.Levelup()
threshold -= M
--n


That's how I'd handle shared party XP.

Lummox JR
In response to Lummox JR
It's a single player version i will add online later. But i'm basically saying that one person is many people instead of a party of a few just going around in turn-based combat making the strongest attack.
In response to Choka
That would work, but it would have it's limitations.

Don't forget to check if it begins improving stats with a negative value. I don't think anyone likes having stats in negatives. (Happened to me once. "Eravius Nero attacked Test! Did -30 damage!")