Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Glitch gameplay JS
Browse files Browse the repository at this point in the history
  • Loading branch information
alirayl committed Nov 19, 2013
0 parents commit 7e2b372
Show file tree
Hide file tree
Showing 2,589 changed files with 986,005 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Glitch Game Server JavaScript Repository #

## License ##

All files are provided by Tiny Speck under the
<a href="http://creativecommons.org/publicdomain/zero/1.0/legalcode">Creative
Commons CC0 1.0 Universal License</a>. This is a broadly permissive "No Rights
Reserved" license — you may do what you please with what we've provided. Our
intention is to dedicate these works to the public domain and make them freely
available to all, without restriction.

All files are provided AS-IS. Tiny Speck cannot provide any support to help you
bring these assets into your own projects. Many of these files are not
structured in a standard, straightforward way, and they may take a bit of
your time and work to understand.

Note: the Glitch logo and trademark are *not* among the things we are making
available under this license. Only items in the files explicitly included
herein are covered.

There is no obligation to link or credit the works, but if you do, please link
to <a href="http://glitchthegame.com">glitchthegame.com</a>, our permanent
"retirement" site for the game and these assets. Of course, links/shoutouts to
Tiny Speck (<a href="http://tinyspeck.com">tinyspeck.com</a>) and/or Slack
(<a href="http://slack.com">slack.com</a>) are appreciated.

## What you'll find in here: ##

Glitch's gameplay was driven entirely by server-side JavaScript running on top
of Rhino (<a href="https://developer.mozilla.org/en-US/docs/Rhino">https://developer.mozilla.org/en-US/docs/Rhino</a>). This repository contains all of that
JavaScript. You'll also find every bit of dialogue in here. If you were ever
wondering how to get a super-rare achievement, you'll find that in here as
well.

## Documentation Contributions Are Welcome! ##

If you figure something out that you think others could learn from, write up a
quick how-to document and submit it to us as a pull request. Share your
knowledge!
61 changes: 61 additions & 0 deletions achievements/1star_cuisinartist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
var name = "1-Star Cuisinartist";
var collection_type = 0;
var is_secret = 0;
var desc = "Whipped up 11 meals with an Awesome Pot";
var status_text = "Now you're cooking! You just earned the title 1-Star Cuisinartist.";
var last_published = 1316304354;
var is_shareworthy = 0;
var url = "1star-cuisinartist";
var category = "cooking";
var url_swf = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/1star_cuisinartist_1304983461.swf";
var url_img_180 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/1star_cuisinartist_1304983461_180.png";
var url_img_60 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/1star_cuisinartist_1304983461_60.png";
var url_img_40 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/1star_cuisinartist_1304983461_40.png";
function on_apply(pc){

}
var conditions = {
42 : {
type : "counter",
group : "making_known_tool",
label : "awesome_pot",
value : "11"
},
};
function onComplete(pc){ // generated from rewards
var multiplier = pc.buffs_has('gift_of_gab') ? 1.2 : pc.buffs_has('silvertongue') ? 1.05 : 1.0;
multiplier += pc.imagination_get_achievement_modifier();
if (/completist/i.exec(this.name)) {
var level = pc.stats_get_level();
if (level > 4) {
multiplier *= (pc.stats_get_level()/4);
}
}
pc.stats_add_xp(round_to_5(75 * multiplier), true);
pc.stats_add_favor_points("pot", round_to_5(10 * multiplier));
pc.making_try_learn_recipe(30);
if(pc.buffs_has('gift_of_gab')) {
pc.buffs_remove('gift_of_gab');
}
else if(pc.buffs_has('silvertongue')) {
pc.buffs_remove('silvertongue');
}
}
var rewards = {
"xp" : 75,
"favor" : {
"giant" : "pot",
"points" : 10
},
"recipes" : {
"0" : {
"recipe_id" : "30",
"label" : "Tasty Pasta",
"id" : 30
}
}
};

//log.info("1star_cuisinartist.js LOADED");

// generated ok (NO DATE)
53 changes: 53 additions & 0 deletions achievements/2nd_rate_piggy_piggy_hash_slinger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
var name = "2nd Rate Piggy Hash Slinger";
var collection_type = 0;
var is_secret = 0;
var desc = "Fed 23 little Piglets until they grew up into Piggies";
var status_text = "Your diligence in feeding 23 Piglets until they grew into Piggies has earned you the distinction of being a 2nd Rate Piggy Hash Slinger.";
var last_published = 1352092060;
var is_shareworthy = 0;
var url = "2nd-rate-piggy-piggy-hash-slinger";
var category = "animals";
var url_swf = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/2nd_rate_piggy_piggy_hash_slinger_1304984245.swf";
var url_img_180 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/2nd_rate_piggy_piggy_hash_slinger_1304984245_180.png";
var url_img_60 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/2nd_rate_piggy_piggy_hash_slinger_1304984245_60.png";
var url_img_40 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/2nd_rate_piggy_piggy_hash_slinger_1304984245_40.png";
function on_apply(pc){

}
var conditions = {
257 : {
type : "counter",
group : "animals_grown",
label : "piglet",
value : "23"
},
};
function onComplete(pc){ // generated from rewards
var multiplier = pc.buffs_has('gift_of_gab') ? 1.2 : pc.buffs_has('silvertongue') ? 1.05 : 1.0;
multiplier += pc.imagination_get_achievement_modifier();
if (/completist/i.exec(this.name)) {
var level = pc.stats_get_level();
if (level > 4) {
multiplier *= (pc.stats_get_level()/4);
}
}
pc.stats_add_xp(round_to_5(200 * multiplier), true);
pc.stats_add_favor_points("humbaba", round_to_5(25 * multiplier));
if(pc.buffs_has('gift_of_gab')) {
pc.buffs_remove('gift_of_gab');
}
else if(pc.buffs_has('silvertongue')) {
pc.buffs_remove('silvertongue');
}
}
var rewards = {
"xp" : 200,
"favor" : {
"giant" : "humbaba",
"points" : 25
}
};

//log.info("2nd_rate_piggy_piggy_hash_slinger.js LOADED");

// generated ok (NO DATE)
61 changes: 61 additions & 0 deletions achievements/2star_cuisinartist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
var name = "2-Star Cuisinartist";
var collection_type = 0;
var is_secret = 0;
var desc = "Whipped up 23 meals with an Awesome Pot";
var status_text = "Soup's on! You've moved up in the ranks to 2-Star Cuisinartist.";
var last_published = 1316304364;
var is_shareworthy = 0;
var url = "2star-cuisinartist";
var category = "cooking";
var url_swf = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/2star_cuisinartist_1304983466.swf";
var url_img_180 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/2star_cuisinartist_1304983466_180.png";
var url_img_60 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/2star_cuisinartist_1304983466_60.png";
var url_img_40 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/2star_cuisinartist_1304983466_40.png";
function on_apply(pc){

}
var conditions = {
43 : {
type : "counter",
group : "making_known_tool",
label : "awesome_pot",
value : "23"
},
};
function onComplete(pc){ // generated from rewards
var multiplier = pc.buffs_has('gift_of_gab') ? 1.2 : pc.buffs_has('silvertongue') ? 1.05 : 1.0;
multiplier += pc.imagination_get_achievement_modifier();
if (/completist/i.exec(this.name)) {
var level = pc.stats_get_level();
if (level > 4) {
multiplier *= (pc.stats_get_level()/4);
}
}
pc.stats_add_xp(round_to_5(150 * multiplier), true);
pc.stats_add_favor_points("pot", round_to_5(20 * multiplier));
pc.making_try_learn_recipe(93);
if(pc.buffs_has('gift_of_gab')) {
pc.buffs_remove('gift_of_gab');
}
else if(pc.buffs_has('silvertongue')) {
pc.buffs_remove('silvertongue');
}
}
var rewards = {
"xp" : 150,
"favor" : {
"giant" : "pot",
"points" : 20
},
"recipes" : {
"0" : {
"recipe_id" : "93",
"label" : "Flummery",
"id" : 93
}
}
};

//log.info("2star_cuisinartist.js LOADED");

// generated ok (NO DATE)
53 changes: 53 additions & 0 deletions achievements/3rd_rate_piggy_hash_slinger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
var name = "3rd Rate Piggy Hash Slinger";
var collection_type = 0;
var is_secret = 0;
var desc = "Fed 3 little Piglets until they grew up into Piggies";
var status_text = "Congratulations on feeding three Piglets until they grew up into Piggies. You are now a 3rd Rate Piggy Hash Slinger. There's a badge and everything.";
var last_published = 1316304311;
var is_shareworthy = 0;
var url = "3rd-rate-piggy-hash-slinger";
var category = "animals";
var url_swf = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/3rd_rate_piggy_hash_slinger_1304984240.swf";
var url_img_180 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/3rd_rate_piggy_hash_slinger_1304984240_180.png";
var url_img_60 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/3rd_rate_piggy_hash_slinger_1304984240_60.png";
var url_img_40 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/3rd_rate_piggy_hash_slinger_1304984240_40.png";
function on_apply(pc){

}
var conditions = {
256 : {
type : "counter",
group : "animals_grown",
label : "piglet",
value : "3"
},
};
function onComplete(pc){ // generated from rewards
var multiplier = pc.buffs_has('gift_of_gab') ? 1.2 : pc.buffs_has('silvertongue') ? 1.05 : 1.0;
multiplier += pc.imagination_get_achievement_modifier();
if (/completist/i.exec(this.name)) {
var level = pc.stats_get_level();
if (level > 4) {
multiplier *= (pc.stats_get_level()/4);
}
}
pc.stats_add_xp(round_to_5(75 * multiplier), true);
pc.stats_add_favor_points("humbaba", round_to_5(10 * multiplier));
if(pc.buffs_has('gift_of_gab')) {
pc.buffs_remove('gift_of_gab');
}
else if(pc.buffs_has('silvertongue')) {
pc.buffs_remove('silvertongue');
}
}
var rewards = {
"xp" : 75,
"favor" : {
"giant" : "humbaba",
"points" : 10
}
};

//log.info("3rd_rate_piggy_hash_slinger.js LOADED");

// generated ok (NO DATE)
61 changes: 61 additions & 0 deletions achievements/3star_cuisinartist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
var name = "3-Star Cuisinartist";
var collection_type = 0;
var is_secret = 0;
var desc = "Whipped up 41 meals with an Awesome Pot";
var status_text = "Don't get in a stew! You've just been promoted to 3-Star Cuisinartist.";
var last_published = 1316304374;
var is_shareworthy = 0;
var url = "3star-cuisinartist";
var category = "cooking";
var url_swf = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/3star_cuisinartist_1304983472.swf";
var url_img_180 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/3star_cuisinartist_1304983472_180.png";
var url_img_60 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/3star_cuisinartist_1304983472_60.png";
var url_img_40 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/3star_cuisinartist_1304983472_40.png";
function on_apply(pc){

}
var conditions = {
44 : {
type : "counter",
group : "making_known_tool",
label : "awesome_pot",
value : "41"
},
};
function onComplete(pc){ // generated from rewards
var multiplier = pc.buffs_has('gift_of_gab') ? 1.2 : pc.buffs_has('silvertongue') ? 1.05 : 1.0;
multiplier += pc.imagination_get_achievement_modifier();
if (/completist/i.exec(this.name)) {
var level = pc.stats_get_level();
if (level > 4) {
multiplier *= (pc.stats_get_level()/4);
}
}
pc.stats_add_xp(round_to_5(250 * multiplier), true);
pc.stats_add_favor_points("pot", round_to_5(30 * multiplier));
pc.making_try_learn_recipe(37);
if(pc.buffs_has('gift_of_gab')) {
pc.buffs_remove('gift_of_gab');
}
else if(pc.buffs_has('silvertongue')) {
pc.buffs_remove('silvertongue');
}
}
var rewards = {
"xp" : 250,
"favor" : {
"giant" : "pot",
"points" : 30
},
"recipes" : {
"0" : {
"recipe_id" : "37",
"label" : "Meat Tetrazzini",
"id" : 37
}
}
};

//log.info("3star_cuisinartist.js LOADED");

// generated ok (NO DATE)
61 changes: 61 additions & 0 deletions achievements/4star_cuisinartist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
var name = "4-Star Cuisinartist";
var collection_type = 0;
var is_secret = 0;
var desc = "Whipped up 79 meals with an Awesome Pot";
var status_text = "Kiss my grits! You've just been promoted to 4-Star Cuisinartist.";
var last_published = 1316304379;
var is_shareworthy = 0;
var url = "4star-cuisinartist";
var category = "cooking";
var url_swf = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/4star_cuisinartist_1304983478.swf";
var url_img_180 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/4star_cuisinartist_1304983478_180.png";
var url_img_60 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/4star_cuisinartist_1304983478_60.png";
var url_img_40 = "http:\/\/c2.glitch.bz\/achievements\/2011-05-09\/4star_cuisinartist_1304983478_40.png";
function on_apply(pc){

}
var conditions = {
47 : {
type : "counter",
group : "making_known_tool",
label : "awesome_pot",
value : "79"
},
};
function onComplete(pc){ // generated from rewards
var multiplier = pc.buffs_has('gift_of_gab') ? 1.2 : pc.buffs_has('silvertongue') ? 1.05 : 1.0;
multiplier += pc.imagination_get_achievement_modifier();
if (/completist/i.exec(this.name)) {
var level = pc.stats_get_level();
if (level > 4) {
multiplier *= (pc.stats_get_level()/4);
}
}
pc.stats_add_xp(round_to_5(350 * multiplier), true);
pc.stats_add_favor_points("pot", round_to_5(45 * multiplier));
pc.making_try_learn_recipe(32);
if(pc.buffs_has('gift_of_gab')) {
pc.buffs_remove('gift_of_gab');
}
else if(pc.buffs_has('silvertongue')) {
pc.buffs_remove('silvertongue');
}
}
var rewards = {
"xp" : 350,
"favor" : {
"giant" : "pot",
"points" : 45
},
"recipes" : {
"0" : {
"recipe_id" : "32",
"label" : "Ix-style Braised Meat",
"id" : 32
}
}
};

//log.info("4star_cuisinartist.js LOADED");

// generated ok (NO DATE)
Loading

0 comments on commit 7e2b372

Please sign in to comment.