12/21 modernizations from TG live (#103)
* sync (#3) * shuttle auto call * Merge /vore into /master (#39) * progress * Compile errors fixed No idea if it's test worthy tho as conflicts with race overhaul and narky removal. * Update admins.txt * efforts continue Fuck grab code, seriously * grab code is cancer * Execute the Narkism Do not hesitate. Show no mercy. * holy shit grab code is awful * have I bitched about grab code My bitching, let me show you it * código de agarre es una mierda No really it is * yeah I don't even know anymore. * Lolnope. Fuck grab code * I'm not even sure what to fix anymore * Self eating is not an acceptable fate * Taste the void, son. * My code doesn't pass it's own sanity check. Maybe it's a sign of things to come. * uncommented and notes * It Works and I Don't Know Why (#38) * shuttle auto call * it works and I don't know why * Subsystem 12/21 Most Recent TG subsystem folder * globalvars 12/21 Tossed out the flavor_misc and parallax files * Onclick 12/21 as well as .dme updates * _defines 12/21 ommited old _MC.dm * _HELPERS 12/21 Preserved snowflake placement of furry sprites * _defeines/genetics reapplied narkism holdover for snowflake races. * Oops forgot mutant colors * modules porting 12/21 + Sounds/icons Admin, Client and most of mob life files ommitted * enviroment file * Admin optimizations ahelp log system kept * Mob ports 12/21 Flavor text preserved * datums ported 12/21 * Game ported 12/21 * batch of duplicate fixes/dogborg work Dogborgs need to be modernized to refractored borg standards. * moar fixes * Maps and futher compile fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
|
||||
/mob/new_player
|
||||
var/ready = 0
|
||||
@@ -201,6 +201,8 @@
|
||||
if(href_list["votepollid"] && href_list["votetype"])
|
||||
var/pollid = text2num(href_list["votepollid"])
|
||||
var/votetype = href_list["votetype"]
|
||||
//lets take data from the user to decide what kind of poll this is, without validating it
|
||||
//what could go wrong
|
||||
switch(votetype)
|
||||
if(POLLTYPE_OPTION)
|
||||
var/optionid = text2num(href_list["voteoptionid"])
|
||||
@@ -219,6 +221,7 @@
|
||||
var/id_max = text2num(href_list["maxid"])
|
||||
|
||||
if( (id_max - id_min) > 100 ) //Basic exploit prevention
|
||||
//(protip, this stops no exploits)
|
||||
usr << "The option ID difference is too big. Please contact administration or the database admin."
|
||||
return
|
||||
|
||||
@@ -257,6 +260,14 @@
|
||||
usr << "<span class='danger'>Maximum replies reached.</span>"
|
||||
break
|
||||
usr << "<span class='notice'>Vote successful.</span>"
|
||||
if(POLLTYPE_IRV)
|
||||
if (!href_list["IRVdata"])
|
||||
src << "<span class='danger'>No ordering data found. Please try again or contact an administrator.</span>"
|
||||
var/list/votelist = splittext(href_list["IRVdata"], ",")
|
||||
if (!vote_on_irv_poll(pollid, votelist))
|
||||
src << "<span class='danger'>Vote failed, please try again or contact an administrator.</span>"
|
||||
return
|
||||
src << "<span class='notice'>Vote successful.</span>"
|
||||
|
||||
/mob/new_player/proc/IsJobAvailable(rank)
|
||||
var/datum/job/job = SSjob.GetJob(rank)
|
||||
@@ -291,8 +302,11 @@
|
||||
|
||||
SSjob.AssignRole(src, rank, 1)
|
||||
|
||||
var/mob/living/carbon/human/character = create_character() //creates the human and transfers vars and mind
|
||||
SSjob.EquipRank(character, rank, 1) //equips the human
|
||||
var/mob/living/character = create_character() //creates the human and transfers vars and mind
|
||||
var/equip = SSjob.EquipRank(character, rank, 1)
|
||||
if(iscyborg(equip)) //Borgs get borged in the equip, so we need to make sure we handle the new mob.
|
||||
character = equip
|
||||
|
||||
|
||||
var/D = pick(latejoin)
|
||||
if(!D)
|
||||
@@ -308,24 +322,30 @@
|
||||
continue
|
||||
|
||||
character.loc = D
|
||||
ticker.minds += character.mind
|
||||
|
||||
if(character.mind.assigned_role != "Cyborg")
|
||||
data_core.manifest_inject(character)
|
||||
ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn
|
||||
AnnounceArrival(character, rank)
|
||||
AddEmploymentContract(character)
|
||||
else
|
||||
character.Robotize()
|
||||
var/mob/living/carbon/human/humanc
|
||||
if(ishuman(character))
|
||||
humanc = character //Let's retypecast the var to be human,
|
||||
|
||||
if(humanc) //These procs all expect humans
|
||||
data_core.manifest_inject(humanc)
|
||||
AnnounceArrival(humanc, rank)
|
||||
AddEmploymentContract(humanc)
|
||||
if(highlander)
|
||||
humanc << "<span class='userdanger'><i>THERE CAN BE ONLY ONE!!!</i></span>"
|
||||
humanc.make_scottish()
|
||||
|
||||
joined_player_list += character.ckey
|
||||
|
||||
if(config.allow_latejoin_antagonists)
|
||||
switch(SSshuttle.emergency.mode)
|
||||
if(SHUTTLE_RECALL, SHUTTLE_IDLE)
|
||||
ticker.mode.make_antag_chance(character)
|
||||
if(SHUTTLE_CALL)
|
||||
if(SSshuttle.emergency.timeLeft(1) > initial(SSshuttle.emergencyCallTime)*0.5)
|
||||
ticker.mode.make_antag_chance(character)
|
||||
if(config.allow_latejoin_antagonists && humanc) //Borgs aren't allowed to be antags. Will need to be tweaked if we get true latejoin ais.
|
||||
if(SSshuttle.emergency)
|
||||
switch(SSshuttle.emergency.mode)
|
||||
if(SHUTTLE_RECALL, SHUTTLE_IDLE)
|
||||
ticker.mode.make_antag_chance(humanc)
|
||||
if(SHUTTLE_CALL)
|
||||
if(SSshuttle.emergency.timeLeft(1) > initial(SSshuttle.emergencyCallTime)*0.5)
|
||||
ticker.mode.make_antag_chance(humanc)
|
||||
qdel(src)
|
||||
|
||||
/mob/new_player/proc/AnnounceArrival(var/mob/living/carbon/human/character, var/rank)
|
||||
@@ -361,12 +381,13 @@
|
||||
|
||||
var/dat = "<div class='notice'>Round Duration: [round(hours)]h [round(mins)]m</div>"
|
||||
|
||||
switch(SSshuttle.emergency.mode)
|
||||
if(SHUTTLE_ESCAPE)
|
||||
dat += "<div class='notice red'>The station has been evacuated.</div><br>"
|
||||
if(SHUTTLE_CALL)
|
||||
if(!SSshuttle.canRecall())
|
||||
dat += "<div class='notice red'>The station is currently undergoing evacuation procedures.</div><br>"
|
||||
if(SSshuttle.emergency)
|
||||
switch(SSshuttle.emergency.mode)
|
||||
if(SHUTTLE_ESCAPE)
|
||||
dat += "<div class='notice red'>The station has been evacuated.</div><br>"
|
||||
if(SHUTTLE_CALL)
|
||||
if(!SSshuttle.canRecall())
|
||||
dat += "<div class='notice red'>The station is currently undergoing evacuation procedures.</div><br>"
|
||||
|
||||
var/available_job_count = 0
|
||||
for(var/datum/job/job in SSjob.occupations)
|
||||
@@ -408,7 +429,7 @@
|
||||
|
||||
var/mob/living/carbon/human/new_character = new(loc)
|
||||
|
||||
if(config.force_random_names || appearance_isbanned(src))
|
||||
if(config.force_random_names || jobban_isbanned(src, "appearance"))
|
||||
client.prefs.random_character()
|
||||
client.prefs.real_name = client.prefs.pref_species.random_name(gender,1)
|
||||
client.prefs.copy_to(new_character)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
/mob/new_player/proc/poll_player(pollid)
|
||||
if(!pollid)
|
||||
return
|
||||
if(!dbcon.IsConnected())
|
||||
if(!establish_db_connection())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
return
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid]")
|
||||
@@ -87,6 +87,7 @@
|
||||
output += "<p><input type='submit' value='Vote'>"
|
||||
output += "</form>"
|
||||
output += "</div>"
|
||||
src << browse(null ,"window=playerpolllist")
|
||||
src << browse(output,"window=playerpoll;size=500x250")
|
||||
if(POLLTYPE_TEXT)
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT replytext FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
@@ -117,6 +118,7 @@
|
||||
else
|
||||
vote_text = replacetext(vote_text, "\n", "<br>")
|
||||
output += "[vote_text]"
|
||||
src << browse(null ,"window=playerpolllist")
|
||||
src << browse(output,"window=playerpoll;size=500x500")
|
||||
if(POLLTYPE_RATING)
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT o.text, v.rating FROM [format_table_name("poll_option")] o, [format_table_name("poll_vote")] v WHERE o.pollid = [pollid] AND v.ckey = '[ckey]' AND o.id = v.optionid")
|
||||
@@ -172,6 +174,7 @@
|
||||
output += "<input type='hidden' name='minid' value='[minid]'>"
|
||||
output += "<input type='hidden' name='maxid' value='[maxid]'>"
|
||||
output += "<p><input type='submit' value='Submit'></form>"
|
||||
src << browse(null ,"window=playerpolllist")
|
||||
src << browse(output,"window=playerpoll;size=500x500")
|
||||
if(POLLTYPE_MULTI)
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
@@ -223,14 +226,133 @@
|
||||
if(!votedfor.len)
|
||||
output += "<p><input type='submit' value='Vote'></form>"
|
||||
output += "</div>"
|
||||
src << browse(null ,"window=playerpolllist")
|
||||
src << browse(output,"window=playerpoll;size=500x250")
|
||||
if(POLLTYPE_IRV)
|
||||
var/datum/asset/irv_assets = get_asset_datum(/datum/asset/simple/IRV)
|
||||
irv_assets.send(src)
|
||||
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
if(!voted_query.Execute())
|
||||
var/err = voted_query.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining optionid from poll_vote table. Error : \[[err]\]\n")
|
||||
return
|
||||
|
||||
var/list/votedfor = list()
|
||||
while(voted_query.NextRow())
|
||||
votedfor.Add(text2num(voted_query.item[1]))
|
||||
|
||||
var/list/datum/polloption/options = list()
|
||||
|
||||
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
|
||||
if(!options_query.Execute())
|
||||
var/err = options_query.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining id, text from poll_option table. Error : \[[err]\]\n")
|
||||
return
|
||||
while(options_query.NextRow())
|
||||
var/datum/polloption/PO = new()
|
||||
PO.optionid = text2num(options_query.item[1])
|
||||
PO.optiontext = options_query.item[2]
|
||||
options["[PO.optionid]"] += PO
|
||||
|
||||
//if they already voted, use their sort
|
||||
if (votedfor.len)
|
||||
var/list/datum/polloption/newoptions = list()
|
||||
for (var/V in votedfor)
|
||||
var/datum/polloption/PO = options["[V]"]
|
||||
if(PO)
|
||||
newoptions["[V]"] = PO
|
||||
options -= "[V]"
|
||||
//add any options that they didn't vote on (some how, some way)
|
||||
options = shuffle(options)
|
||||
for (var/V in options)
|
||||
newoptions["[V]"] = options["[V]"]
|
||||
options = newoptions
|
||||
//otherwise, lets shuffle it.
|
||||
else
|
||||
var/list/datum/polloption/newoptions = list()
|
||||
while (options.len)
|
||||
var/list/local_options = options.Copy()
|
||||
var/key
|
||||
//the jist is we randomly remove all options from a copy of options until only one reminds,
|
||||
// move that over to our new list
|
||||
// and repeat until we've moved all of them
|
||||
while (local_options.len)
|
||||
key = local_options[rand(1, local_options.len)]
|
||||
local_options -= key
|
||||
var/value = options[key]
|
||||
options -= key
|
||||
newoptions[key] = value
|
||||
options = newoptions
|
||||
|
||||
var/output = {"
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<script src="jquery-1.10.2.min.js"></script>
|
||||
<script src="jquery-ui.custom-core-widgit-mouse-sortable-min.js"></script>
|
||||
<style>
|
||||
#sortable { list-style-type: none; margin: 0; padding: 2em; }
|
||||
#sortable li { min-height: 1em; margin: 0px 1px 1px 1px; padding: 1px; border: 1px solid black; border-radius: 5px; background-color: white; cursor:move;}
|
||||
#sortable .sortable-placeholder-highlight { min-height: 1em; margin: 0 2px 2px 2px; padding: 2px; border: 1px dotted blue; border-radius: 5px; background-color: GhostWhite; }
|
||||
span.grippy { content: '....'; width: 10px; height: 20px; display: inline-block; overflow: hidden; line-height: 5px; padding: 3px 1px; cursor: move; vertical-align: middle; margin-top: -.7em; margin-right: .3em; font-size: 12px; font-family: sans-serif; letter-spacing: 2px; color: #cccccc; text-shadow: 1px 0 1px black; }
|
||||
span.grippy::after { content: '.. .. .. ..';}
|
||||
</style>
|
||||
<script>
|
||||
$(function() {
|
||||
$( "#sortable" ).sortable({
|
||||
placeholder: "sortable-placeholder-highlight",
|
||||
axis: "y",
|
||||
containment: "#ballot",
|
||||
scroll: false,
|
||||
cursor: "ns-resize",
|
||||
tolerance: "pointer"
|
||||
});
|
||||
$( "#sortable" ).disableSelection();
|
||||
$('form').submit(function(){
|
||||
$('#IRVdata').val($( "#sortable" ).sortable("toArray", { attribute: "voteid" }));
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div align='center'><B>Player poll</B><hr>
|
||||
<b>Question: [pollquestion]</b><br>Please sort the options in the order of <b>most preferred</b> to <b>least preferred</b><br>
|
||||
<font size='2'>Revoting has been enabled on this poll, if you think you made a mistake, simply revote<br></font>
|
||||
<font size='2'>Poll runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>
|
||||
</div>
|
||||
<form name='cardcomp' action='?src=\ref[src]' method='POST'>
|
||||
<input type='hidden' name='src' value='\ref[src]'>
|
||||
<input type='hidden' name='votepollid' value='[pollid]'>
|
||||
<input type='hidden' name='votetype' value=[POLLTYPE_IRV]>
|
||||
<input type='hidden' name='IRVdata' id='IRVdata'>
|
||||
<div id="ballot" class="center">
|
||||
<b><center>Most Preferred</center></b>
|
||||
<ol id="sortable" class="rankings" style="padding:0px">
|
||||
"}
|
||||
for(var/O in options)
|
||||
var/datum/polloption/PO = options["[O]"]
|
||||
if(PO.optionid && PO.optiontext)
|
||||
output += "<li voteid='[PO.optionid]' class='ranking'><span class='grippy'></span> [PO.optiontext]</li>\n"
|
||||
output += {"
|
||||
</ol>
|
||||
<b><center>Least Preferred</center></b><br>
|
||||
</div>
|
||||
<p><input type='submit' value='[( votedfor.len ? "Re" : "")]Vote'></form>
|
||||
"}
|
||||
src << browse(null ,"window=playerpolllist")
|
||||
src << browse(output,"window=playerpoll;size=500x500")
|
||||
return
|
||||
|
||||
/mob/new_player/proc/poll_check_voted(pollid, table)
|
||||
if(!dbcon.IsConnected())
|
||||
/mob/new_player/proc/poll_check_voted(pollid, text = FALSE)
|
||||
var/table = "poll_vote"
|
||||
if (text)
|
||||
table = "poll_textreply"
|
||||
if (!establish_db_connection())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
return
|
||||
var/DBQuery/query_hasvoted = dbcon.NewQuery("SELECT id FROM [format_table_name(table)] WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
var/DBQuery/query_hasvoted = dbcon.NewQuery("SELECT id FROM `[format_table_name(table)]` WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
if(!query_hasvoted.Execute())
|
||||
var/err = query_hasvoted.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining id from [table] table. Error : \[[err]\]\n")
|
||||
@@ -243,10 +365,134 @@
|
||||
. = client.holder.rank
|
||||
return .
|
||||
|
||||
|
||||
/mob/new_player/proc/vote_rig_check()
|
||||
if (usr != src)
|
||||
if (!usr || !src)
|
||||
return 0
|
||||
//we gots ourselfs a dirty cheater on our hands!
|
||||
log_game("[key_name(usr)] attempted to rig the vote by voting as [ckey]")
|
||||
message_admins("[key_name_admin(usr)] attempted to rig the vote by voting as [ckey]")
|
||||
usr << "<span class='danger'>You don't seem to be [ckey].</span>"
|
||||
src << "<span class='danger'>Something went horribly wrong processing your vote. Please contact an administrator, they should have gotten a message about this</span>"
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/new_player/proc/vote_valid_check(pollid, holder, type)
|
||||
if (!establish_db_connection())
|
||||
src << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
return 0
|
||||
pollid = text2num(pollid)
|
||||
if (!pollid || pollid < 0)
|
||||
return 0
|
||||
//validate the poll is actually the right type of poll and its still active
|
||||
var/DBQuery/select_query = dbcon.NewQuery({"
|
||||
SELECT id
|
||||
FROM [format_table_name("poll_question")]
|
||||
WHERE
|
||||
[(holder ? "" : "adminonly = false AND")]
|
||||
id = [pollid]
|
||||
AND
|
||||
Now() BETWEEN starttime AND endtime
|
||||
AND
|
||||
polltype = '[type]'
|
||||
"})
|
||||
if (!select_query.Execute())
|
||||
var/err = select_query.ErrorMsg()
|
||||
log_game("SQL ERROR validating poll via poll_question table. Error : \[[err]\]\n")
|
||||
return 0
|
||||
if (!select_query.NextRow())
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/new_player/proc/vote_on_irv_poll(pollid, list/votelist)
|
||||
if (!establish_db_connection())
|
||||
src << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
return 0
|
||||
if (!vote_rig_check())
|
||||
return 0
|
||||
pollid = text2num(pollid)
|
||||
if (!pollid || pollid < 0)
|
||||
return 0
|
||||
if (!votelist || !istype(votelist) || !votelist.len)
|
||||
return 0
|
||||
if (!client)
|
||||
return 0
|
||||
//save these now so we can still process the vote if the client goes away while we process.
|
||||
var/datum/admins/holder = client.holder
|
||||
var/rank = "Player"
|
||||
if (holder)
|
||||
rank = holder.rank
|
||||
var/ckey = client.ckey
|
||||
var/address = client.address
|
||||
|
||||
//validate the poll
|
||||
if (!vote_valid_check(pollid, holder, POLLTYPE_IRV))
|
||||
return 0
|
||||
|
||||
//lets collect the options
|
||||
var/DBQuery/options_query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
|
||||
if (!options_query.Execute())
|
||||
var/err = options_query.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining id from poll_option table. Error : \[[err]\]\n")
|
||||
return 0
|
||||
var/list/optionlist = list()
|
||||
while (options_query.NextRow())
|
||||
optionlist += text2num(options_query.item[1])
|
||||
|
||||
//validate their votes are actually in the list of options and actually numbers
|
||||
var/list/numberedvotelist = list()
|
||||
for (var/vote in votelist)
|
||||
vote = text2num(vote)
|
||||
numberedvotelist += vote
|
||||
if (!vote) //this is fine because voteid starts at 1, so it will never be 0
|
||||
src << "<span class='danger'>Error: Invalid (non-numeric) votes in the vote data.</span>"
|
||||
return 0
|
||||
if (!(vote in optionlist))
|
||||
src << "<span class='danger'>Votes for choices that do not appear to be in the poll detected<span>"
|
||||
return 0
|
||||
if (!numberedvotelist.len)
|
||||
src << "<span class='danger'>Invalid vote data</span>"
|
||||
return 0
|
||||
|
||||
//lets add the vote, first we generate a insert statement.
|
||||
|
||||
var/sqlrowlist = ""
|
||||
for (var/vote in numberedvotelist)
|
||||
if (sqlrowlist != "")
|
||||
sqlrowlist += ", " //a comma (,) at the start of the first row to insert will trigger a SQL error
|
||||
sqlrowlist += "(Now(), [pollid], [vote], '[sanitizeSQL(ckey)]', '[sanitizeSQL(address)]', '[sanitizeSQL(rank)]')"
|
||||
|
||||
//now lets delete their old votes (if any)
|
||||
var/DBQuery/voted_query = dbcon.NewQuery("DELETE FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
if (!voted_query.Execute())
|
||||
var/err = voted_query.ErrorMsg()
|
||||
log_game("SQL ERROR clearing out old votes. Error : \[[err]\]\n")
|
||||
return 0
|
||||
|
||||
//now to add the new ones.
|
||||
var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES [sqlrowlist]")
|
||||
if(!query_insert.Execute())
|
||||
var/err = query_insert.ErrorMsg()
|
||||
log_game("SQL ERROR adding vote to table. Error : \[[err]\]\n")
|
||||
src << "<span class='danger'>Error adding vote.</span>"
|
||||
return 0
|
||||
src << browse(null,"window=playerpoll")
|
||||
return 1
|
||||
|
||||
|
||||
/mob/new_player/proc/vote_on_poll(pollid, optionid)
|
||||
if(!establish_db_connection())
|
||||
src << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
return 0
|
||||
if (!vote_rig_check())
|
||||
return 0
|
||||
if(!pollid || !optionid)
|
||||
return
|
||||
var/adminrank = poll_check_voted(pollid, "poll_vote")
|
||||
//validate the poll
|
||||
if (!vote_valid_check(pollid, client.holder, POLLTYPE_OPTION))
|
||||
return 0
|
||||
var/adminrank = poll_check_voted(pollid)
|
||||
if(!adminrank)
|
||||
return
|
||||
var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES (Now(), [pollid], [optionid], '[ckey]', '[client.address]', '[adminrank]')")
|
||||
@@ -258,12 +504,20 @@
|
||||
return 1
|
||||
|
||||
/mob/new_player/proc/log_text_poll_reply(pollid, replytext)
|
||||
if(!establish_db_connection())
|
||||
src << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
return 0
|
||||
if (!vote_rig_check())
|
||||
return 0
|
||||
if(!pollid)
|
||||
return
|
||||
//validate the poll
|
||||
if (!vote_valid_check(pollid, client.holder, POLLTYPE_TEXT))
|
||||
return 0
|
||||
if(!replytext)
|
||||
usr << "The text you entered was blank. Please correct the text and submit again."
|
||||
return
|
||||
var/adminrank = poll_check_voted(pollid, "poll_textreply")
|
||||
var/adminrank = poll_check_voted(pollid, TRUE)
|
||||
if(!adminrank)
|
||||
return
|
||||
replytext = sanitizeSQL(replytext)
|
||||
@@ -279,11 +533,16 @@
|
||||
return 1
|
||||
|
||||
/mob/new_player/proc/vote_on_numval_poll(pollid, optionid, rating)
|
||||
if(!establish_db_connection())
|
||||
src << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
return 0
|
||||
if (!vote_rig_check())
|
||||
return 0
|
||||
if(!pollid || !optionid || !rating)
|
||||
return
|
||||
if(!dbcon.IsConnected())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
return
|
||||
//validate the poll
|
||||
if (!vote_valid_check(pollid, client.holder, POLLTYPE_RATING))
|
||||
return 0
|
||||
var/DBQuery/query_hasvoted = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND ckey = '[ckey]'")
|
||||
if(!query_hasvoted.Execute())
|
||||
var/err = query_hasvoted.ErrorMsg()
|
||||
@@ -304,11 +563,16 @@
|
||||
return 1
|
||||
|
||||
/mob/new_player/proc/vote_on_multi_poll(pollid, optionid)
|
||||
if(!establish_db_connection())
|
||||
src << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
return 0
|
||||
if (!vote_rig_check())
|
||||
return 0
|
||||
if(!pollid || !optionid)
|
||||
return 1
|
||||
if(!dbcon.IsConnected())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
return 1
|
||||
//validate the poll
|
||||
if (!vote_valid_check(pollid, client.holder, POLLTYPE_MULTI))
|
||||
return 0
|
||||
var/DBQuery/query_get_choicelen = dbcon.NewQuery("SELECT multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid]")
|
||||
if(!query_get_choicelen.Execute())
|
||||
var/err = query_get_choicelen.ErrorMsg()
|
||||
|
||||
@@ -61,21 +61,26 @@
|
||||
if(previewJob)
|
||||
mannequin.job = previewJob.title
|
||||
previewJob.equip(mannequin, TRUE)
|
||||
|
||||
CHECK_TICK
|
||||
preview_icon = icon('icons/effects/effects.dmi', "nothing")
|
||||
preview_icon.Scale(48+32, 16+32)
|
||||
|
||||
CHECK_TICK
|
||||
mannequin.setDir(NORTH)
|
||||
|
||||
var/icon/stamp = getFlatIcon(mannequin)
|
||||
CHECK_TICK
|
||||
preview_icon.Blend(stamp, ICON_OVERLAY, 25, 17)
|
||||
|
||||
CHECK_TICK
|
||||
mannequin.setDir(WEST)
|
||||
stamp = getFlatIcon(mannequin)
|
||||
CHECK_TICK
|
||||
preview_icon.Blend(stamp, ICON_OVERLAY, 1, 9)
|
||||
|
||||
CHECK_TICK
|
||||
mannequin.setDir(SOUTH)
|
||||
stamp = getFlatIcon(mannequin)
|
||||
CHECK_TICK
|
||||
preview_icon.Blend(stamp, ICON_OVERLAY, 49, 1)
|
||||
|
||||
CHECK_TICK
|
||||
preview_icon.Scale(preview_icon.Width() * 2, preview_icon.Height() * 2) // Scaling here to prevent blurring in the browser.
|
||||
CHECK_TICK
|
||||
qdel(mannequin)
|
||||
|
||||
@@ -59,10 +59,8 @@
|
||||
var/locked = 0 //Is this part locked from roundstart selection? Used for parts that apply effects
|
||||
var/dimension_x = 32
|
||||
var/dimension_y = 32
|
||||
var/extra = 0
|
||||
var/center = FALSE //Should we center the sprite?
|
||||
var/extra = 0 //Used for extra overlays on top of the bodypart that may be colored seperately. Uses the secondary mutant color as default. See species.dm for the actual overlay code.
|
||||
var/extra_icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
var/extra_color_src = MUTCOLORS2 //The color source for the extra overlay.
|
||||
|
||||
//////////////////////
|
||||
// Hair Definitions //
|
||||
@@ -70,10 +68,6 @@
|
||||
/datum/sprite_accessory/hair
|
||||
icon = 'icons/mob/human_face.dmi' // default icon for all hairs
|
||||
|
||||
/datum/sprite_accessory/hair/bald //Moved to the top so we can all stop scrolling all the way down.
|
||||
name = "Bald"
|
||||
icon_state = null
|
||||
|
||||
/datum/sprite_accessory/hair/short
|
||||
name = "Short Hair" // try to capatilize the names please~
|
||||
icon_state = "hair_a" // you do not need to define _s or _l sub-states, game automatically does this for you
|
||||
@@ -399,6 +393,10 @@
|
||||
name = "Balding Hair"
|
||||
icon_state = "hair_e"
|
||||
|
||||
/datum/sprite_accessory/hair/bald
|
||||
name = "Bald"
|
||||
icon_state = null
|
||||
|
||||
/datum/sprite_accessory/hair/parted
|
||||
name = "Side Part"
|
||||
icon_state = "hair_part"
|
||||
@@ -467,6 +465,10 @@
|
||||
name = "Bob Hair 2"
|
||||
icon_state = "hair_bob2"
|
||||
|
||||
/datum/sprite_accessory/hair/boddicker
|
||||
name = "Boddicker"
|
||||
icon_state = "hair_boddicker"
|
||||
|
||||
/datum/sprite_accessory/hair/long
|
||||
name = "Long Hair 1"
|
||||
icon_state = "hair_long"
|
||||
@@ -495,6 +497,10 @@
|
||||
name = "Long Side Part"
|
||||
icon_state = "hair_longsidepart"
|
||||
|
||||
/datum/sprite_accessory/hair/sidecut
|
||||
name = "Sidecut"
|
||||
icon_state = "hair_sidecut"
|
||||
|
||||
/////////////////////////////
|
||||
// Facial Hair Definitions //
|
||||
/////////////////////////////
|
||||
@@ -579,6 +585,11 @@
|
||||
name = "Fu Manchu"
|
||||
icon_state = "facial_fumanchu"
|
||||
|
||||
/datum/sprite_accessory/facial_hair/brokenman
|
||||
name = "Broken Man"
|
||||
icon_state = "facial_brokenman"
|
||||
|
||||
|
||||
///////////////////////////
|
||||
// Underwear Definitions //
|
||||
///////////////////////////
|
||||
@@ -1128,35 +1139,20 @@
|
||||
|
||||
/datum/sprite_accessory/body_markings
|
||||
icon = 'icons/mob/mutant_bodyparts.dmi'
|
||||
color_src = MUTCOLORS2
|
||||
|
||||
/datum/sprite_accessory/body_markings/none
|
||||
name = "None"
|
||||
icon_state = "none"
|
||||
|
||||
/datum/sprite_accessory/body_markings/dstripe
|
||||
name = "Dark Stripe"
|
||||
icon_state = "dstripe"
|
||||
|
||||
/datum/sprite_accessory/body_markings/lstripe
|
||||
name = "Light Stripe"
|
||||
icon_state = "lstripe"
|
||||
|
||||
/datum/sprite_accessory/body_markings/dtiger
|
||||
name = "Dark Tiger Body"
|
||||
icon_state = "dtiger"
|
||||
|
||||
/datum/sprite_accessory/body_markings/dtigerhead
|
||||
name = "Dark Tiger Body + Head"
|
||||
icon_state = "dtigerhead"
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/body_markings/ltiger
|
||||
name = "Light Tiger Body"
|
||||
icon_state = "ltiger"
|
||||
|
||||
/datum/sprite_accessory/body_markings/ltigerhead
|
||||
name = "Light Tiger Body + Head"
|
||||
icon_state = "ltigerhead"
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/body_markings/lbelly
|
||||
name = "Light Belly"
|
||||
@@ -1177,30 +1173,6 @@
|
||||
name = "Smooth"
|
||||
icon_state = "smooth"
|
||||
|
||||
/datum/sprite_accessory/tails/lizard/light
|
||||
name = "Light"
|
||||
icon_state = "light"
|
||||
|
||||
/datum/sprite_accessory/tails_animated/lizard/light
|
||||
name = "Light"
|
||||
icon_state = "light"
|
||||
|
||||
/datum/sprite_accessory/tails/lizard/dstripe
|
||||
name = "Dark Stripe"
|
||||
icon_state = "dstripe"
|
||||
|
||||
/datum/sprite_accessory/tails_animated/lizard/dstripe
|
||||
name = "Dark Stripe"
|
||||
icon_state = "dstripe"
|
||||
|
||||
/datum/sprite_accessory/tails/lizard/lstripe
|
||||
name = "Light Stripe"
|
||||
icon_state = "lstripe"
|
||||
|
||||
/datum/sprite_accessory/tails_animated/lizard/lstripe
|
||||
name = "Light Stripe"
|
||||
icon_state = "lstripe"
|
||||
|
||||
/datum/sprite_accessory/tails/lizard/dtiger
|
||||
name = "Dark Tiger"
|
||||
icon_state = "dtiger"
|
||||
@@ -1217,23 +1189,13 @@
|
||||
name = "Light Tiger"
|
||||
icon_state = "ltiger"
|
||||
|
||||
/datum/sprite_accessory/tails/lizard/club
|
||||
name = "Club"
|
||||
icon_state = "club"
|
||||
/datum/sprite_accessory/tails/lizard/spikes
|
||||
name = "Spikes"
|
||||
icon_state = "spikes"
|
||||
|
||||
/datum/sprite_accessory/tails_animated/lizard/club
|
||||
name = "Club"
|
||||
icon_state = "club"
|
||||
|
||||
/datum/sprite_accessory/tails/lizard/aqua
|
||||
name = "Aquatic"
|
||||
icon_state = "aqua"
|
||||
|
||||
/datum/sprite_accessory/tails_animated/lizard/aqua
|
||||
name = "Aquatic"
|
||||
icon_state = "aqua"
|
||||
|
||||
/datum/sprite_accessory/tails/human
|
||||
/datum/sprite_accessory/tails_animated/lizard/spikes
|
||||
name = "Spikes"
|
||||
icon_state = "spikes"
|
||||
|
||||
/datum/sprite_accessory/tails/human/none
|
||||
name = "None"
|
||||
@@ -1246,10 +1208,12 @@
|
||||
/datum/sprite_accessory/tails/human/cat
|
||||
name = "Cat"
|
||||
icon_state = "cat"
|
||||
color_src = HAIR
|
||||
|
||||
/datum/sprite_accessory/tails_animated/human/cat
|
||||
name = "Cat"
|
||||
icon_state = "cat"
|
||||
color_src = HAIR
|
||||
|
||||
/datum/sprite_accessory/snouts
|
||||
icon = 'icons/mob/mutant_bodyparts.dmi'
|
||||
@@ -1308,6 +1272,7 @@
|
||||
name = "Cat"
|
||||
icon_state = "cat"
|
||||
hasinner = 1
|
||||
color_src = HAIR
|
||||
|
||||
/datum/sprite_accessory/wings/none
|
||||
name = "None"
|
||||
@@ -1409,6 +1374,15 @@
|
||||
name = "Aquatic"
|
||||
icon_state = "aqua"
|
||||
|
||||
/datum/sprite_accessory/legs //legs are a special case, they aren't actually sprite_accessories but are updated with them.
|
||||
icon = null //These datums exist for selecting legs on preference, and little else
|
||||
|
||||
/datum/sprite_accessory/legs/none
|
||||
name = "Normal Legs"
|
||||
|
||||
/datum/sprite_accessory/legs/digitigrade_lizard
|
||||
name = "Digitigrade Legs"
|
||||
|
||||
//Human Ears/Tails
|
||||
|
||||
/datum/sprite_accessory/ears/fox
|
||||
@@ -1499,6 +1473,7 @@
|
||||
color_src = 0
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
|
||||
/datum/sprite_accessory/tails_animated/human/murid
|
||||
name = "Murid"
|
||||
icon_state = "murid"
|
||||
@@ -1595,13 +1570,13 @@
|
||||
name = "Fox"
|
||||
icon_state = "fox"
|
||||
extra = 1
|
||||
extra_color_src = MUTCOLORS2
|
||||
// extra_color_src = MUTCOLORS2
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated/fox
|
||||
name = "Fox"
|
||||
icon_state = "fox"
|
||||
extra = 1
|
||||
extra_color_src = MUTCOLORS2
|
||||
// extra_color_src = MUTCOLORS2
|
||||
|
||||
//Fennec
|
||||
/datum/sprite_accessory/mam_ears/fennec
|
||||
@@ -1725,6 +1700,7 @@
|
||||
/datum/sprite_accessory/xeno_head/none
|
||||
name = "None"
|
||||
|
||||
|
||||
/datum/sprite_accessory/xeno_head/hunter
|
||||
name = "Hunter"
|
||||
icon_state = "hunter"
|
||||
@@ -1736,7 +1712,7 @@
|
||||
/datum/sprite_accessory/xeno_head/sentinel
|
||||
name = "Sentinel"
|
||||
icon_state = "sentinel"
|
||||
|
||||
/*
|
||||
//Slimecoon Parts
|
||||
/datum/sprite_accessory/slimecoon_ears
|
||||
icon = 'icons/mob/exotic_bodyparts.dmi'
|
||||
@@ -1749,4 +1725,4 @@
|
||||
/datum/sprite_accessory/slimecoon_snout
|
||||
icon = 'icons/mob/exotic_bodyparts.dmi'
|
||||
name = "Hunter"
|
||||
icon_state = "slimecoon"
|
||||
icon_state = "slimecoon" */
|
||||
Reference in New Issue
Block a user