whisper.cat stuff
BIN
cdn/Arch-Small.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
cdn/Background.png
Normal file
After Width: | Height: | Size: 2.5 MiB |
BIN
cdn/Background2.png
Normal file
After Width: | Height: | Size: 6.6 MiB |
BIN
cdn/FT8DMC.jpg
Normal file
After Width: | Height: | Size: 128 KiB |
BIN
cdn/ITU-CQZONE.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
cdn/MSHV.webp
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
cdn/Manjaro_Small.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
cdn/Mast_Nov_09_22.png
Normal file
After Width: | Height: | Size: 5.3 MiB |
BIN
cdn/QF22oe-IOTAOC001.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
cdn/Welcome.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
cdn/gitlab-80-80.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
cdn/libera80-80.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
cdn/mastodon-80-80.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
cdn/twitter-80-80.png
Normal file
After Width: | Height: | Size: 11 KiB |
146
dev/index.html
Normal file
@ -0,0 +1,146 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
|
||||
<html> <head> <title>dev.whisper.cat</title> <style>
|
||||
body {
|
||||
width: 35em;
|
||||
margin: 0 auto;
|
||||
font-family: monospace;
|
||||
font-size: 125%;
|
||||
color: green;
|
||||
background-image: url("https://cdn.whisper.cat/Background2.png");
|
||||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
background-size: cover;
|
||||
}a:link {
|
||||
color: green;
|
||||
background-color: transparent;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: pink;
|
||||
background-color: transparent;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: red;
|
||||
background-color: transparent;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:active {
|
||||
color: yellow;
|
||||
background-color: transparent;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 700px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 700px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
border: 3px solid magenta;
|
||||
padding: 2%;
|
||||
|
||||
}
|
||||
.cat {
|
||||
width: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
border: 3px solid magenta;
|
||||
padding: 2%;
|
||||
|
||||
}
|
||||
|
||||
.social-flex {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: 100%;
|
||||
}
|
||||
/* small computer screens */
|
||||
@media only screen and (max-width: 992px) {
|
||||
.container {
|
||||
width: 550px;
|
||||
}
|
||||
}
|
||||
|
||||
/* tablets */
|
||||
@media only screen and (max-width: 768px) {
|
||||
.container {
|
||||
width: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
/* phones */
|
||||
@media only screen and (max-width: 600px) {
|
||||
.container {
|
||||
width: auto;
|
||||
margin: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
</style> </head>
|
||||
<body>
|
||||
<div class="cat">
|
||||
<div>
|
||||
<pre><b>
|
||||
<span style="color:yellow;font-weight:italic">
|
||||
* * *
|
||||
__ * *
|
||||
,db' * * * *
|
||||
,d8/ * * * *
|
||||
888 . *
|
||||
`db\ * * * *
|
||||
`o`_ **
|
||||
* * *</span>
|
||||
_
|
||||
/ )
|
||||
(\__/) ( (
|
||||
,-.,-.,) (.,-.,-.,-.) ).,-.,-.
|
||||
| @| ={ }= | @| / / | @|o |
|
||||
_j__j__j_) `-------/ /__j__j__j_
|
||||
________( /___________
|
||||
| | @| \ || o|O | @|
|
||||
|o | |,'\ , ,'"| | | |
|
||||
vV\|/vV|`-'\ ,---\ | \Vv\hjwVv\//v
|
||||
_) ) `. \ /
|
||||
(__/ ) )
|
||||
(_/</b></pre>
|
||||
|
||||
<span style="color:purple;font-weight:italic"><center><h1>Welcome to<h1> <h2>dev.whisper.cat</h2></center></span>
|
||||
<center><p>-</p>
|
||||
<p><a href="irc://sodium.libera.chat/whisper.cat">irc#whisper.cat@libera.chat</a> <p><a href="https://gitea.whisper.cat">Gitea</a> | <a href="https://sdr.whisper.cat">Online HF/VHF/UHF SDR</a></p>
|
||||
<p>-</p>
|
||||
<a href="https://weboasis.whisper.cat">Weboasis Mirror</a> | <a href="https://weboasis.whisper.cat/torrent/">Webtorrent Client</a> | <a href="https://weboasis.whisper.cat/tv/">Live TV Streams</a></p>
|
||||
<p>-</p>
|
||||
<span style="color:white;font-weight:italic"><p>This is a development environment, Things are prone to breaking here</p>
|
||||
<p>I'll fix them at some point in time :)</p></span>
|
||||
<span style="color:white;font-weight:italic"><p>If are accessing this website because you had some issue with the traffic coming from this IP.</p>
|
||||
<p>Click here: <a href="https://tor.whisper.cat">https://tor.whisper.cat</a></p></span>
|
||||
<p>-</p>
|
||||
<b><img src="https://hotemoji.com/images/dl/x/flag-of-ukraine-emoji-by-google.png" alt="#WeStandWithUkraine" width="100" height="100">
|
||||
<p><p><span style="color:Blue;font-weight:bold">#WeStand</span><span style="color:Yellow;font-weight:bold">WithUkraine</span></p>
|
||||
<p>-</p>
|
||||
</div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
207
homepage/aboutme/index.html
Normal file
@ -0,0 +1,207 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<title>Whisper.cat | About Me</title>
|
||||
<style>
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-family: monospace;
|
||||
font-size: 100%;
|
||||
color: rgb(255, 255, 255);
|
||||
background: rgba(87, 3, 189);
|
||||
#background-image: url("https://cdn.whisper.cat/Background2.png");
|
||||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 700px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.sticky-div {
|
||||
background-color: rgb(98, 0, 128);
|
||||
position: sticky;
|
||||
top: 0px;
|
||||
padding: 5px 0px;
|
||||
color : rgb(34, 255, 0);
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
border: 3px solid magenta;
|
||||
padding: 2%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.social-flex {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: 100%;
|
||||
}
|
||||
/* small computer screens */
|
||||
@media only screen and (max-width: 992px) {
|
||||
.container {
|
||||
width: 550px;
|
||||
}
|
||||
}
|
||||
|
||||
/* tablets */
|
||||
@media only screen and (max-width: 768px) {
|
||||
.container {
|
||||
width: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
/* phones */
|
||||
@media only screen and (max-width: 600px) {
|
||||
.container {
|
||||
width: auto;
|
||||
margin: 1em;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="sticky-div">
|
||||
<center><a href="https://whisper.cat">Homepage</a> | <a href="https://weboasis.whisper.cat">Weboasis Mirror</a> | <a href="https://weboasis.whisper.cat/torrent/">Webtorrent Client</a> | <a href="https://weboasis.whisper.cat/tv/">Live TV Streams</a> | <a href="https://gitea.whisper.cat">Gitea</a> | <a href="https://sdr.whisper.cat">Online HF/VHF/UHF SDR</a></p></center>
|
||||
</div>
|
||||
<html>
|
||||
<div class="container">
|
||||
<div>
|
||||
|
||||
<span style="color: rgb(255, 255, 255); font-weight: italic">
|
||||
<h1>About Me</h1>
|
||||
</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<span style="color: Magenta; font-weight: italic">
|
||||
<h2>
|
||||
<b><p>Harper Innes ( She - Her / They - Them )</p></b>
|
||||
</h2>
|
||||
<h2>
|
||||
<b>Pronounced as: Har-per Inn-es</b>
|
||||
</h2>
|
||||
</span>
|
||||
<p>_______</p>
|
||||
<span style="color: rgb(255, 255, 255); font-weight: italic">
|
||||
<h3>
|
||||
|
||||
<style>
|
||||
a {
|
||||
color: rgb(34, 255, 0);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<p>Hello there!</p>
|
||||
<p>I'm a Neurodivergent Non-Binary Trans person from Melbourne, Australia</p>
|
||||
<p>I currently run the domain "whisper[.]cat" and several other bits of Infrastructure that support it's existance. </p>
|
||||
<p>This is a continual work in progress,</p>
|
||||
<p>So you may find stuff broken from time to time! Opps~.</p>
|
||||
<p>_______</p>
|
||||
<p>I'm a big believer in the freedom of the Internet and run several Tor Relay nodes to support the <a href="https://en.wikipedia.org/wiki/Tor_(network)">Onion Network (TOR)</a></p>
|
||||
<p>_______</p>
|
||||
<p>By day I'm a Systems Administrator and Network Engineer with experience in Linux Systems, Cisco, Cpanel, Nginx, Pterodactyl to name a few</p>
|
||||
<p>_______</p>
|
||||
<p>My hobbies include</p>
|
||||
<p><a href="https://en.wikipedia.org/wiki/Amateur_radio">Amateur (HAM) Radio</a> with over 14 thousand contacts and 160 countries contacted,</p>
|
||||
<p>Photography, Cycling, Video Gaming & Electronics Tinkering</p>
|
||||
<p>_______</p>
|
||||
<p>If you'd like to know more,</p>
|
||||
<p>Please contact me on one of my social medias (Icons below) or email me</p>
|
||||
<p>
|
||||
Contact me:
|
||||
<a href="mailto:webmaster@whisper.cat"
|
||||
>webmaster@whisper.cat</a
|
||||
>
|
||||
<p>-</p>
|
||||
<p>
|
||||
|
||||
<a href="https://whisper.cat">Return to Homepage</a>
|
||||
</p>
|
||||
</h3>
|
||||
<p>-</p>
|
||||
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="social-flex">
|
||||
<div>
|
||||
<a href="https://gitlab.com/m0ze1r">
|
||||
<img
|
||||
alt="m0ze1r@Gitlab"
|
||||
src="https://cdn.whisper.cat/gitlab-80-80.png"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://twitter.com/InnesHarper_">
|
||||
<img
|
||||
alt="Twitter"
|
||||
src="https://cdn.whisper.cat/twitter-80-80.png"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://slowest.network/@harper">
|
||||
<img
|
||||
alt="Mastodon"
|
||||
src="https://cdn.whisper.cat/mastodon-80-80.png"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="irc://sodium.libera.chat/whisper.cat">
|
||||
<img
|
||||
alt="irc#whisper.cat@libera.chat"
|
||||
src="https://cdn.whisper.cat/libera80-80.png"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="social-flex">
|
||||
<div>
|
||||
<img
|
||||
src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Nonbinary_flag.svg/300px-Nonbinary_flag.svg.png"
|
||||
alt="#NonBinaryRights #TheyThem"
|
||||
width="100"
|
||||
height="67"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<img
|
||||
src="https://upload.wikimedia.org/wikipedia/commons/f/fd/LGBTQ%2B_rainbow_flag_Quasar_%22Progress%22_variant.svg"
|
||||
alt="#LGBTIRights"
|
||||
width="100"
|
||||
height="67"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<img
|
||||
src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Transgender_Pride_flag.svg/1920px-Transgender_Pride_flag.svg.png"
|
||||
alt="#TransRights"
|
||||
width="100"
|
||||
height="67"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<span style="color: Yellow; font-weight: italic"></span>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
||||
</body>
|
||||
</html>
|
229
homepage/index.html
Normal file
@ -0,0 +1,229 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<title>whisper.cat</title>
|
||||
<style>
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-family: monospace;
|
||||
font-size: 100%;
|
||||
color: rgb(255, 255, 255);
|
||||
background: black;
|
||||
#background-image: url("background2.jpg");
|
||||
opacity: 0.9;
|
||||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
background-size: cover;
|
||||
|
||||
}
|
||||
.sticky-div {
|
||||
background-color: rgb(98, 0, 128);
|
||||
position: sticky;
|
||||
top: 0px;
|
||||
padding: 5px 0px;
|
||||
color : rgb(34, 255, 0);
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 700px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
border: 3px solid magenta;
|
||||
padding: 2%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.social-flex {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: 100%;
|
||||
}
|
||||
/* small computer screens */
|
||||
@media only screen and (max-width: 992px) {
|
||||
.container {
|
||||
width: 550px;
|
||||
}
|
||||
}
|
||||
|
||||
/* tablets */
|
||||
@media only screen and (max-width: 768px) {
|
||||
.container {
|
||||
width: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
/* phones */
|
||||
@media only screen and (max-width: 600px) {
|
||||
.container {
|
||||
width: auto;
|
||||
margin: 1em;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<div class="sticky-div">
|
||||
<center><a href="https://whisper.cat/aboutme">About me</a> | <a href="https://weboasis.whisper.cat">Weboasis Mirror</a> | <a href="https://weboasis.whisper.cat/torrent/">Webtorrent Client</a> | <a href="https://weboasis.whisper.cat/tv/">Live TV Streams</a> | <a href="https://gitea.whisper.cat">Gitea</a> | <a href="https://sdr.whisper.cat">Online HF/VHF/UHF SDR</a></p></center>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="social-flex"><pre><b>
|
||||
<span style="color:yellow;font-weight:italic">
|
||||
* * *
|
||||
__ * *
|
||||
,db' * * * *
|
||||
,d8/ * * * *
|
||||
888 . *
|
||||
`db\ * * * *
|
||||
`o`_ **
|
||||
* * *</span>
|
||||
_
|
||||
/ )
|
||||
(\__/) ( (
|
||||
,-.,-.,) (.,-.,-.,-.) ).,-.,-.
|
||||
| @| ={ }= | @| / / | @|o |
|
||||
_j__j__j_) `-------/ /__j__j__j_
|
||||
________( /___________
|
||||
| | @| \ || o|O | @|
|
||||
|o | |,'\ , ,'"| | | |
|
||||
vV\|/vV|`-'\ ,---\ | \Vv\hjwVv\//v
|
||||
_) ) `. \ /
|
||||
(__/ ) )
|
||||
(_/</b></pre></div>
|
||||
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div>
|
||||
<p>-</p>
|
||||
<span style="color: White; font-weight: italic">
|
||||
|
||||
</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
<span style="color: Magenta; font-weight: italic">
|
||||
<h2>
|
||||
<b><p>Welcome to</p></b>
|
||||
</h2>
|
||||
<h2>
|
||||
<b>Whisper.cat</b>
|
||||
</h2>
|
||||
</span>
|
||||
<p>_______</p>
|
||||
<style>
|
||||
a {
|
||||
color: rgb(34, 255, 0);
|
||||
}
|
||||
|
||||
</style>
|
||||
<p>-</p>
|
||||
<span style="color:white;font-weight:italic"><p>If are accessing this website because you had some issue with the traffic coming from this IP.</p>
|
||||
<p>Click here: <a href="https://tor.whisper.cat">https://tor.whisper.cat</a></p></span>
|
||||
<p>-</p>
|
||||
<p>Gitea IS LIVE!, It's running on IPv6 (As all things should be these days >_>), But as described below you can still visit and use the site even if you're on IPv4!</p>
|
||||
<p>-</p>
|
||||
<p>Whisper.cat has now moved webserver locations, We are on IPv6 ONLY, However you can still visit our site if you are only on IPv4!</p>
|
||||
<p>I'm hoping this fixes some loading speed issues that have been brought to my attention</p>
|
||||
<p>We hope you enjoy this new speedy experience, Welcome to the future! :)</p>
|
||||
<p>-</p>
|
||||
<p>Whisper.cat has also moved it's mailserver, If you're not receiving emails from us, Please check your spam box
|
||||
Im working hard to try and correct these issues but the current server where the mail is hosted on has been abused for spam
|
||||
so it may take some time until we are delisted from blacklists, Sorry in advance
|
||||
</p>
|
||||
<b><img src="https://hotemoji.com/images/dl/x/flag-of-ukraine-emoji-by-google.png" alt="#WeStandWithUkraine" width="100" height="100">
|
||||
<p><p><span style="color:Blue;font-weight:bold">#WeStand</span><span style="color:Yellow;font-weight:bold">WithUkraine</span></p>
|
||||
<p>-</p>
|
||||
</h3>
|
||||
<p>-</p>
|
||||
<p>
|
||||
Contact me:
|
||||
<a href="mailto:webmaster@whisper.cat"
|
||||
>webmaster@whisper.cat</a
|
||||
>
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="social-flex">
|
||||
<div>
|
||||
<a href="https://gitlab.com/m0ze1r">
|
||||
<img
|
||||
alt="m0ze1r@Gitlab"
|
||||
src="https://cdn.whisper.cat/gitlab-80-80.png"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://twitter.com/InnesHarper_">
|
||||
<img
|
||||
alt="Twitter"
|
||||
src="https://cdn.whisper.cat/twitter-80-80.png"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://slowest.network/@harper">
|
||||
<img
|
||||
alt="Mastodon"
|
||||
src="https://cdn.whisper.cat/mastodon-80-80.png"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="irc://sodium.libera.chat/whisper.cat">
|
||||
<img
|
||||
alt="irc#whisper.cat@libera.chat"
|
||||
src="https://cdn.whisper.cat/libera80-80.png"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="social-flex">
|
||||
<div>
|
||||
<img
|
||||
src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Nonbinary_flag.svg/300px-Nonbinary_flag.svg.png"
|
||||
alt="#NonBinaryRights #TheyThem"
|
||||
width="100"
|
||||
height="67"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<img
|
||||
src="https://upload.wikimedia.org/wikipedia/commons/f/fd/LGBTQ%2B_rainbow_flag_Quasar_%22Progress%22_variant.svg"
|
||||
alt="#LGBTIRights"
|
||||
width="100"
|
||||
height="67"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<img
|
||||
src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Transgender_Pride_flag.svg/1920px-Transgender_Pride_flag.svg.png"
|
||||
alt="#TransRights"
|
||||
width="100"
|
||||
height="67"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<span style="color: Yellow; font-weight: italic"></span>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
13
weboasis/.htaccess
Normal file
@ -0,0 +1,13 @@
|
||||
Options +FollowSymLinks
|
||||
Options -Indexes
|
||||
ErrorDocument 403 /403.html
|
||||
ErrorDocument 404 /404.html
|
||||
<Files .htaccess>
|
||||
order allow,deny
|
||||
deny from all
|
||||
</Files>
|
||||
RewriteEngine On
|
||||
RewriteCond %{HTTP_HOST} ^www\. [NC,OR]
|
||||
RewriteCond %{HTTPS} off
|
||||
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
|
||||
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L,NE]
|
76
weboasis/403.html
Normal file
@ -0,0 +1,76 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us" class="no-js">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>WebOas.is - Error 403</title>
|
||||
<meta name="description" content="WebOas.is - Error 403 - Not Authorized!">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<!-- ================= Favicon ================== -->
|
||||
<!-- Standard -->
|
||||
<link rel="shortcut icon" href="https://weboasis.whisper.cat/error/img/favicon.png">
|
||||
<!-- Retina iPad Touch Icon-->
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://weboasis.whisper.cat/error/img/favicon-retina-ipad.png">
|
||||
<!-- Retina iPhone Touch Icon-->
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://weboasis.whisper.cat/error/img/favicon-retina-iphone.png">
|
||||
<!-- Standard iPad Touch Icon-->
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://weboasis.whisper.cat/error/img/favicon-standard-ipad.png">
|
||||
<!-- Standard iPhone Touch Icon-->
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://weboasis.whisper.cat/error/img/favicon-standard-iphone.png">
|
||||
|
||||
<!-- ============== Resources style ============== -->
|
||||
<link rel="stylesheet" href="https://weboasis.whisper.cat/error/css/style-vintage.css" />
|
||||
|
||||
<!-- Modernizr runs quickly on page load to detect features -->
|
||||
<script src="https://weboasis.whisper.cat/error/js/modernizr.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div class="overlay"></div>
|
||||
|
||||
<div class="item-title">
|
||||
|
||||
<div id="message"></div>
|
||||
|
||||
<div class="link-bottom">
|
||||
<a class="link-icon" href="https://weboasis.whisper.cat"><i class="icon ion-ios-home"></i> Home</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ///////////////////\\\\\\\\\\\\\\\\\\\ -->
|
||||
<!-- ********** Resources jQuery ********** -->
|
||||
<!-- \\\\\\\\\\\\\\\\\\\/////////////////// -->
|
||||
|
||||
<!-- * Libraries jQuery, Easing and Bootstrap - Be careful to not remove them * -->
|
||||
<script src="https://weboasis.whisper.cat/error/js/jquery.min.js"></script>
|
||||
<script src="https://weboasis.whisper.cat/error/js/jquery.easings.min.js"></script>
|
||||
<script src="https://weboasis.whisper.cat/error/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Slideshow plugin -->
|
||||
<script src="https://weboasis.whisper.cat/error/js/vegas.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$('body').vegas({
|
||||
slides: [
|
||||
{ src: 'https://weboasis.whisper.cat/error/img/background-vintage.jpg' },
|
||||
],
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Main JS File -->
|
||||
<script src="https://weboasis.whisper.cat/error/js/main-vintage-403.js"></script>
|
||||
|
||||
<!--[if lt IE 10]><script type="text/javascript" src="https://weboasis.whisper.cat/error/js/placeholder.js"></script><![endif]-->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
76
weboasis/404.html
Normal file
@ -0,0 +1,76 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us" class="no-js">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>WebOas.is - Error 404</title>
|
||||
<meta name="description" content="WebOas.is - Error 404 - Page Not Found!">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<!-- ================= Favicon ================== -->
|
||||
<!-- Standard -->
|
||||
<link rel="shortcut icon" href="https://weboasis.whisper.cat/error/img/favicon.png">
|
||||
<!-- Retina iPad Touch Icon-->
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://weboasis.whisper.cat/error/img/favicon-retina-ipad.png">
|
||||
<!-- Retina iPhone Touch Icon-->
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://weboasis.whisper.cat/error/img/favicon-retina-iphone.png">
|
||||
<!-- Standard iPad Touch Icon-->
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://weboasis.whisper.cat/error/img/favicon-standard-ipad.png">
|
||||
<!-- Standard iPhone Touch Icon-->
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://weboasis.whisper.cat/error/img/favicon-standard-iphone.png">
|
||||
|
||||
<!-- ============== Resources style ============== -->
|
||||
<link rel="stylesheet" href="https://weboasis.whisper.cat/error/css/style-vintage.css" />
|
||||
|
||||
<!-- Modernizr runs quickly on page load to detect features -->
|
||||
<script src="https://weboasis.whisper.cat/error/js/modernizr.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div class="overlay"></div>
|
||||
|
||||
<div class="item-title">
|
||||
|
||||
<div id="message"></div>
|
||||
|
||||
<div class="link-bottom">
|
||||
<a class="link-icon" href="https://weboasis.whisper.cat"><i class="icon ion-ios-home"></i> Home</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ///////////////////\\\\\\\\\\\\\\\\\\\ -->
|
||||
<!-- ********** Resources jQuery ********** -->
|
||||
<!-- \\\\\\\\\\\\\\\\\\\/////////////////// -->
|
||||
|
||||
<!-- * Libraries jQuery, Easing and Bootstrap - Be careful to not remove them * -->
|
||||
<script src="https://weboasis.whisper.cat/error/js/jquery.min.js"></script>
|
||||
<script src="https://weboasis.whisper.cat/error/js/jquery.easings.min.js"></script>
|
||||
<script src="https://weboasis.whisper.cat/error/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Slideshow plugin -->
|
||||
<script src="https://weboasis.whisper.cat/error/js/vegas.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$('body').vegas({
|
||||
slides: [
|
||||
{ src: 'https://weboasis.whisper.cat/error/img/background-vintage.jpg' },
|
||||
],
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Main JS File -->
|
||||
<script src="https://weboasis.whisper.cat/error/js/main-vintage.js"></script>
|
||||
|
||||
<!--[if lt IE 10]><script type="text/javascript" src="https://weboasis.whisper.cat/error/js/placeholder.js"></script><![endif]-->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
830
weboasis/LinksNeedAdded.txt
Normal file
@ -0,0 +1,830 @@
|
||||
-=|Links|=-
|
||||
https://github.com/Ethereal-Developers-Inc/OpenScan
|
||||
https://perkeep.org
|
||||
https://github.com/GRVYDEV/Project-Lightspeed
|
||||
https://vertical.carrd.co
|
||||
https://docs.inlets.dev
|
||||
https://sqlitebrowser.org
|
||||
http://inloop.github.io/sqlite-viewer/
|
||||
https://caprover.com
|
||||
https://ngrok.com
|
||||
https://localhost.run
|
||||
https://localxpose.io
|
||||
https://packetriot.com
|
||||
https://portmap.io
|
||||
https://pagekite.net
|
||||
https://github.com/antoniomika/sish
|
||||
https://github.com/PrivateBin/PrivateBin
|
||||
https://github.com/OSSystems/compress-tools-rs
|
||||
https://github.com/rust-lang/rustlings
|
||||
https://www.neverware.com
|
||||
https://courvix.com
|
||||
https://debuild.co
|
||||
https://blankslate.io
|
||||
https://netwrks.io/beta
|
||||
https://interviews.school
|
||||
https://openai.com/blog/dall-e/
|
||||
https://github.com/redianmarku/Django-Twitter-Clone
|
||||
https://github.com/NawalJAhmed/Django-YouTube-App
|
||||
https://github.com/chunkydonut21/Youtube-Downloader
|
||||
https://languagedrops.com
|
||||
https://www.ghostcapital.org
|
||||
https://ezhevika.blogspot.com
|
||||
https://www.dreamweapons.net
|
||||
https://rockonvinyl.blogspot.com
|
||||
https://15.ai
|
||||
https://www.opensource-socialnetwork.org
|
||||
https://handshake.org
|
||||
https://timetagger.app
|
||||
https://fountainofdreams.net
|
||||
https://foambubble.github.io/foam/
|
||||
https://www.sleuthkit.org/autopsy/
|
||||
https://github.com/WorldBrain/Memex
|
||||
https://github.com/EionRobb/purple-rocketchat
|
||||
https://github.com/niclashoyer/pidgin-emojione
|
||||
https://github.com/popey/sosumi-snap
|
||||
https://github.com/dhsdshdhk/stegpy
|
||||
https://www.jingos.com
|
||||
https://runson.cloud
|
||||
https://redact.carrd.co
|
||||
https://a11yresources.webflow.io
|
||||
https://newsclapper.com
|
||||
https://onlysponsors.dev
|
||||
https://filmulator.org
|
||||
https://loveeevee.github.io/Dots-Converter/
|
||||
https://wikipedia-live-monitor.herokuapp.com
|
||||
https://github.com/rxi/lite
|
||||
https://gtfobins.github.io
|
||||
https://securitytxt.org
|
||||
https://www.msgsafe.io
|
||||
https://skiftos.org
|
||||
https://animate.style
|
||||
https://web.chemdoodle.com
|
||||
https://heartrate.netlify.app
|
||||
https://www.synfig.org
|
||||
https://www.charlielee.uk/boats-animator/
|
||||
https://www.qstopmotion.org
|
||||
https://maple.pet/webgbcam/
|
||||
https://www.recursive.design
|
||||
http://teavm.org
|
||||
https://newreleases.io
|
||||
https://getaether.net
|
||||
https://screeps.com
|
||||
https://codespells.org
|
||||
https://archivy.github.io
|
||||
https://www.insecam.org
|
||||
http://arbtt.nomeata.de
|
||||
https://asdf-vm.com
|
||||
https://www.ytt-tech.com
|
||||
https://github.com/penpot/penpot
|
||||
https://zbox.io/fs/
|
||||
https://cyberpunk-life.neocities.org
|
||||
https://reports.exodus-privacy.eu.org/en/
|
||||
https://espanso.org
|
||||
https://premid.app
|
||||
https://litestream.io
|
||||
https://keycombiner.com
|
||||
https://en.jingos.com
|
||||
https://getleon.ai
|
||||
https://yippy.com
|
||||
https://rate.sx
|
||||
https://arc.io
|
||||
https://siasky.net
|
||||
https://sonobus.net
|
||||
https://www.sourcetrail.com
|
||||
https://ardupilot.org
|
||||
https://same.energy
|
||||
https://open5g.info
|
||||
https://fatboy.site
|
||||
https://zone.vision
|
||||
https://calladev.com
|
||||
https://adversarial.io
|
||||
https://www.snowtrack.io
|
||||
https://www.importyeti.com
|
||||
https://answerthepublic.com
|
||||
https://github.com/onivim/oni2
|
||||
https://github.com/hakavlad/nohang
|
||||
https://github.com/rand-net/khan-dl
|
||||
https://github.com/svenmauch/WinSlap
|
||||
https://github.com/techtanic/proton-bot
|
||||
https://github.com/exadel-inc/CompreFace
|
||||
https://wereturtle.github.io/ghostwriter/
|
||||
https://github.com/techtanic/Udemy-Course-Grabber
|
||||
http://stahlworks.com/dev/swiss-file-knife.html
|
||||
https://github.com/Tribler/trustchain-superapp
|
||||
https://play.google.com/store/apps/details?id=nl.tudelft.trustchain
|
||||
https://gitlab.com/Mr_Goldberg/goldberg_emulator
|
||||
https://github.com/Oros42/IMSI-catcher
|
||||
https://makenweb.com/SpleeterGUI
|
||||
https://bitcoiner.live
|
||||
https://android.izzysoft.de/repo
|
||||
https://github.com/albertomosconi/foss-apps
|
||||
https://www.ambient-mixer.com
|
||||
https://github.com/schollz/croc
|
||||
https://orph.link/tripgen
|
||||
https://chimu.moe/en/
|
||||
https://www.thedarkmod.com
|
||||
https://www.memeatlas.com
|
||||
https://video2x.org
|
||||
https://counter.dev
|
||||
https://hub.balena.io
|
||||
https://malsync.moe
|
||||
https://fantasyanime.com
|
||||
https://info.stylee32.net
|
||||
https://soda.privatevoid.net/num/links/
|
||||
https://peelopaalu.neocities.org
|
||||
https://acko.net
|
||||
https://gourav.io/clone-wars
|
||||
https://gitlab.com/bramw/baserow
|
||||
https://github.com/ififfy/flipflip/
|
||||
https://github.com/manuGMG/1fichier-dl
|
||||
https://github.com/5ut/DiskCord
|
||||
https://www.namebase.io
|
||||
https://critter.camera
|
||||
https://pwoss.org
|
||||
https://poa.st
|
||||
https://fsi-languages.yojik.eu
|
||||
https://www.leocad.org
|
||||
https://www.freecadweb.org
|
||||
https://artvee.com
|
||||
https://www.syntropystack.com
|
||||
https://fyptt.to
|
||||
https://www.schneier.com
|
||||
https://en.cppreference.com/w/
|
||||
https://github.com/DidierRLopes/GamestonkTerminal
|
||||
https://github.com/Ryochan7/DS4Windows
|
||||
https://github.com/ridhwaans/homehost
|
||||
https://github.com/qarmin/czkawka
|
||||
https://searchmysite.net
|
||||
https://www.ekioh.com/flow-browser/
|
||||
https://zoomescaper.com
|
||||
https://newsit.benwinding.com
|
||||
https://www.animatedknots.com
|
||||
https://www.focalboard.com
|
||||
https://chartscss.org
|
||||
https://dogehouse.tv
|
||||
https://soap2day.to
|
||||
https://www.shellcheck.net
|
||||
https://github.com/lminiero/jamrtc
|
||||
https://nixnet.services
|
||||
https://40two.app
|
||||
https://send.lambda.dance
|
||||
https://ytdl.actionsack.com
|
||||
https://github.com/ntaraujo/killer
|
||||
https://github.com/CorentinJ/Real-Time-Voice-Cloning
|
||||
https://github.com/SystemErrorWang/White-box-Cartoonization
|
||||
https://github.com/lllyasviel/style2paints
|
||||
https://github.com/vijishmadhavan/ArtLine
|
||||
https://github.com/microsoft/codetour
|
||||
https://github.com/EleutherAI/gpt-neo/
|
||||
https://github.com/NikolaiT/zardaxt/
|
||||
https://guitarix.org
|
||||
https://muse-sequencer.github.io
|
||||
https://www.hedsound.com
|
||||
https://gdevelop-app.com
|
||||
https://editor.godotengine.org/releases/latest/
|
||||
https://godotengine.org
|
||||
https://github.com/nccgroup/solitude
|
||||
https://github.com/sunilkumarvalmiki/Anonymous-Developemnt-Resources
|
||||
https://github.com/zhw2590582/ArtPlayer
|
||||
https://github.com/NadalVRoMa/PyLibGen
|
||||
https://github.com/acidicoala/ScreamAPI
|
||||
https://github.com/shiftrot/droidvim
|
||||
https://openmidiproject.osdn.jp/Sekaiju_en.html
|
||||
https://www.beermoneyforum.com
|
||||
https://sec.report
|
||||
https://groups.io
|
||||
https://fretflip.com/guitar-scales
|
||||
https://www.lightnote.co
|
||||
https://thecum.zone
|
||||
https://rentry.co/FMHY
|
||||
http://simpledesktops.com
|
||||
https://easypeasymethod.org
|
||||
https://algorithm-visualizer.org
|
||||
https://www.bigocheatsheet.com
|
||||
https://sotabench.com
|
||||
https://pedoblock.ignorelist.com
|
||||
https://proxyman.io
|
||||
https://octoprint.org
|
||||
https://musical-artifacts.com
|
||||
https://archiveofourown.org
|
||||
https://www.xapo.com
|
||||
https://fireball.de
|
||||
https://sherlock-holm.es
|
||||
https://www.acapellas4u.co.uk
|
||||
https://script.tv
|
||||
https://www.instructables.com
|
||||
https://librexapp.com
|
||||
https://james.darpinian.com/satellites/
|
||||
https://openarena.ws
|
||||
https://www.openttd.org
|
||||
https://neverball.org
|
||||
https://www.ourboard.io
|
||||
https://code.kryo.se/iodine/
|
||||
https://inspirobot.me
|
||||
https://www.owleyes.org
|
||||
https://bitclout.com
|
||||
https://www.dreamcrafter.dev
|
||||
https://github.com/lucidrains/deep-daze
|
||||
https://www.syedgakbar.com/projects/dst
|
||||
https://m3u4u.com
|
||||
https://del.dog
|
||||
https://ohshitgit.com
|
||||
https://thebypasser.com
|
||||
https://manga4life.com
|
||||
https://brie.fi/ng
|
||||
https://github.com/FelisCatus/SwitchyOmega
|
||||
https://gitlab.com/cosmosapps/stealth
|
||||
https://gitlab.com/tzkuat/Ressources
|
||||
https://discordthread.date
|
||||
https://www.multy.me
|
||||
https://netograph.io
|
||||
https://www.firefly-iii.org
|
||||
https://ueli.app
|
||||
https://www.shipmap.org
|
||||
https://www.yubico.com/products/
|
||||
https://userstyles.world
|
||||
https://www.databreaches.net/news/
|
||||
https://videy.co
|
||||
https://8mb.video
|
||||
https://disclose.io
|
||||
https://pixelfed.org
|
||||
https://www.wombo.ai
|
||||
https://up.loaded.ie
|
||||
https://qu.ax
|
||||
https://midi.moe
|
||||
https://youdieifyou.work
|
||||
https://inventory.raw.pm
|
||||
https://hackmd.io
|
||||
http://spek.cc
|
||||
https://www.canva.com
|
||||
https://www.figma.com
|
||||
https://www.screentogif.com
|
||||
https://www.onyphe.io
|
||||
https://www.givesendgo.com
|
||||
https://emojify.info
|
||||
https://github.com/netdata/netdata
|
||||
https://www.monitorix.org
|
||||
https://healthchecks.io
|
||||
https://volmarg.github.io
|
||||
https://github.com/opensearch-project/OpenSearch
|
||||
https://noncesense-research-lab.github.io
|
||||
https://ez.lol
|
||||
https://aggie.io
|
||||
https://apps.sentinel-hub.com/eo-browser/
|
||||
https://mailvelope.com
|
||||
https://security-list.js.org
|
||||
https://tinytools.directory
|
||||
https://survol.me
|
||||
https://trackmybacklink.com
|
||||
https://nute.app
|
||||
https://stacks.rocks
|
||||
https://umami.is
|
||||
https://ackee.electerious.com
|
||||
https://github.com/dynobo/normcap
|
||||
https://github.com/Hari-Nagarajan/fairgame
|
||||
https://www.carlostoxtli.com/docs2web/
|
||||
https://itus.space
|
||||
https://grocy.info
|
||||
https://www.twuko.com
|
||||
https://www.geo-fs.com
|
||||
https://slimwiki.com
|
||||
https://my.new
|
||||
https://platfor.io
|
||||
https://tusk.page
|
||||
https://pidgin.im
|
||||
https://obsidian.md
|
||||
https://www.loudreader.com
|
||||
https://havenweb.org
|
||||
https://kinopio.club
|
||||
https://activitywatch.net
|
||||
https://otp.landian.vip/en-us/
|
||||
https://shadow.github.io
|
||||
https://www.itpro.tv
|
||||
https://asciinema.org
|
||||
https://api.vevioz.com
|
||||
https://github.com/mayfrost/guides
|
||||
https://github.com/jaakkopasanen/AutoEq
|
||||
https://openastrotech.com
|
||||
https://spacedashboard.com
|
||||
https://termshark.io
|
||||
https://projectifi.io
|
||||
https://trackercontrol.org
|
||||
https://msguides.com
|
||||
https://textfancy.com
|
||||
https://satellitemap.space
|
||||
https://findstarlink.com
|
||||
https://screenshot.rocks
|
||||
https://thelibrarymap.com
|
||||
https://github.com/spotify-util/ViewPlaylistsWithSong
|
||||
https://github.com/osmoscraft/osmosfeed
|
||||
https://readme.so
|
||||
https://github.com/psanford/wormhole-william
|
||||
https://github.com/Jacalz/wormhole-gui
|
||||
https://gitlab.com/Gnurur/chad_launcher
|
||||
https://github.com/lulzsun/blitz-app-adblock
|
||||
https://blitz.gg
|
||||
https://obsidianapp.io
|
||||
https://github1s.com
|
||||
https://deepart.io
|
||||
https://openboard.ch/index.en.html
|
||||
https://github.com/nativefier/nativefier
|
||||
https://watchitapp.site
|
||||
https://mapchart.net
|
||||
https://rawgraphs.io
|
||||
https://portfolio.zxh.io
|
||||
https://wowidget.github.io
|
||||
https://typatone.com
|
||||
https://whyp.it
|
||||
https://sw.ink
|
||||
https://clash.me
|
||||
https://omegat.org
|
||||
https://crawl.develz.org
|
||||
https://github.com/lebr0nli/slader-extension
|
||||
https://www.shelf.so
|
||||
https://tunnelbroker.net
|
||||
https://bitflock.com
|
||||
http://atlasengineering.io
|
||||
https://github.com/AlexeyAB/darknet
|
||||
https://minimal.gallery
|
||||
https://volument.com
|
||||
https://j4ck.com
|
||||
https://filen.io
|
||||
https://padlet.com
|
||||
https://schemeflood.com
|
||||
https://pulsedive.com
|
||||
https://github.com/qarmin/szyszka
|
||||
https://github.com/AkihiroSuda/lima
|
||||
https://github.com/tallero/PGPgram
|
||||
https://github.com/TeamShinkansen/Hakchi2-CE
|
||||
https://github.com/KMFDManic/NESC-SNESC-Modifications
|
||||
https://www.digwebinterface.com
|
||||
https://www.thingsmadethinkable.com
|
||||
https://digi.vatlib.it
|
||||
https://directmusic.me/wav2png/
|
||||
https://stealth.org
|
||||
https://www.stealthpay.com
|
||||
https://supertokens.io
|
||||
https://www.gasnow.org
|
||||
https://superchange.is
|
||||
https://iina.io
|
||||
https://stackblitz.com
|
||||
https://crackitindonesia.com
|
||||
https://wakelet.com
|
||||
https://voice2json.org
|
||||
https://github.com/mikroskeem/tosh
|
||||
https://github.com/dkgv/pinpoint
|
||||
https://www.gbasil.dev/bookmarklets
|
||||
https://www.nocodb.com
|
||||
https://clickhouse.tech
|
||||
https://automationadmin.com/2016/02/bookmarks/
|
||||
https://github.com/sorenisanerd/gotty
|
||||
https://www.pirateship.com
|
||||
https://github.com/cotnw/muvi
|
||||
https://openmhz.com
|
||||
https://www.diybookscanner.org
|
||||
https://www.intodns.com
|
||||
https://whoisrequest.com
|
||||
https://www.whoxy.com/whois-history/
|
||||
https://www.mindforger.com
|
||||
https://asuswrt-merlin.net
|
||||
https://www.snbforums.com
|
||||
https://ide.onelang.io
|
||||
https://www.appgyver.com
|
||||
https://tiddlywiki.com
|
||||
https://www.rock.so
|
||||
https://check.njal.la/dns/
|
||||
https://domain.glass
|
||||
https://mastershot.app
|
||||
https://github.com/jostroOS/amogOS
|
||||
https://imgproxify.com
|
||||
https://imgfo.com
|
||||
https://upflix.pro
|
||||
https://embedy.cc
|
||||
https://snyk.io
|
||||
http://nyanko.ws/nymphcast.php
|
||||
https://github.com/major/MySQLTuner-perl
|
||||
https://github.com/black7375/Firefox-UI-Fix
|
||||
https://github.com/Franiac/TwitchLeecher
|
||||
https://forget.codl.fr/about/
|
||||
https://peux-os.netlify.app
|
||||
https://diyhue.github.io
|
||||
https://vimium.github.io
|
||||
https://sun.aweray.com
|
||||
https://www.broker.xxx
|
||||
https://home.trebel.io
|
||||
https://wormhole.app
|
||||
https://tetr.io
|
||||
https://old.reddit.com/r/shoppingbay/
|
||||
https://old.reddit.com/r/RedditbayPro/
|
||||
https://old.reddit.com/r/TheSellSpot/
|
||||
https://old.reddit.com/r/REDDITTBAY/
|
||||
https://old.reddit.com/r/Shopping/
|
||||
https://dnstats.net
|
||||
https://github.com/ufb/Textmarker
|
||||
https://app.keeweb.info
|
||||
https://ms-paint-i.de
|
||||
https://neko.bar
|
||||
https://github.com/kangyu-california/PersistentWindows
|
||||
https://github.com/ibraheemdev/modern-unix
|
||||
https://github.com/ripmeapp/ripme
|
||||
https://github.com/bee-san/pyWhat
|
||||
https://weho.st
|
||||
https://noamp.link
|
||||
https://nuitka.net
|
||||
https://wayfinder.nfb.ca
|
||||
https://www.improv-wifi.com
|
||||
https://gamefaqs.gamespot.com
|
||||
https://www.whatfinger.com
|
||||
http://www.foundphotos.net
|
||||
https://projectmoon.dance
|
||||
https://pingme.lmno.pk
|
||||
https://6b.eleuther.ai
|
||||
http://www.editthiscookie.com
|
||||
https://www.twitch.tv/dutchsinseofficial
|
||||
https://github.com/dertuxmalwieder/yaydl
|
||||
https://eternalbox.dev/jukebox_index.html
|
||||
https://rave.dj
|
||||
https://altstore.io
|
||||
https://contactfound.com
|
||||
https://gethuman.com
|
||||
https://buttplug.io
|
||||
https://toyhou.se
|
||||
https://aes67.app
|
||||
https://webpy.org
|
||||
https://sizzy.app
|
||||
https://rizonrice.club
|
||||
https://www.deflemask.com
|
||||
https://github.com/hatoo/oha
|
||||
https://locust.io
|
||||
https://k6.io
|
||||
https://www.sequencer64.com
|
||||
https://wiki.mobileread.com/wiki/Main_Page
|
||||
https://www.mobileread.com/forums/
|
||||
https://tannerv.com/ipod/
|
||||
https://freeotp.github.io
|
||||
https://d3fend.mitre.org
|
||||
https://v2.onivim.io
|
||||
https://github.com/andresriancho/w3af/
|
||||
https://goodreports.com
|
||||
https://github.com/BHSPitMonkey/ninjam-js
|
||||
https://github.com/kingoflolz/mesh-transformer-jax
|
||||
https://github.com/Mayandev/hacker-feeds-cli
|
||||
https://johnfactotum.github.io/foliate/
|
||||
https://anvaka.github.io/sayit/
|
||||
https://www.randomlists.com
|
||||
https://world.openfoodfacts.org
|
||||
https://createfeed.fivefilters.org
|
||||
https://mapmaker.nationalgeographic.org
|
||||
https://feed-me-up-scotty.vincenttunru.com
|
||||
https://nightly.link
|
||||
https://earthly.dev
|
||||
https://afdah.info
|
||||
https://jukeblocks.io
|
||||
https://www.shutupandtakemymoney.com
|
||||
https://www.thisiswhyimbroke.com
|
||||
https://opensearch.org
|
||||
https://wiki.nikitavoloboev.xyz
|
||||
https://kartaview.org
|
||||
https://music.ishkur.com
|
||||
https://prolific.co
|
||||
https://github.com/rileytestut/Delta
|
||||
https://github.com/guihkx/spotishush
|
||||
https://github.com/SathyaBhat/spotify-dl
|
||||
https://github.com/qrpike/spotify-playlist-downloader
|
||||
https://addons.mozilla.org/en-US/firefox/addon/spotishush/
|
||||
https://addons.mozilla.org/en-US/firefox/addon/port-authority/
|
||||
https://deaditarchive.netlify.app
|
||||
http://jackal.surge.sh
|
||||
https://beeref.org
|
||||
https://lazyweb.ai
|
||||
https://github.com/localtunnel/localtunnel
|
||||
https://github.com/zodiacon/RegExp
|
||||
https://birdnet.cornell.edu
|
||||
https://copilot.github.com
|
||||
https://www.nocode.tech
|
||||
https://www.internal.io
|
||||
https://www.makerpad.co
|
||||
https://www.appsmith.com
|
||||
https://rocketreach.co
|
||||
https://punkspider.org
|
||||
https://cipher387.github.io
|
||||
https://www.stockupcrypto.com
|
||||
https://github.com/amirgamil/apollo
|
||||
https://gitlab.com/piracy/piracy
|
||||
https://livepeer.org
|
||||
https://apse.io
|
||||
https://snapcamera.snapchat.com
|
||||
https://goaccess.io
|
||||
https://mactype.net
|
||||
https://relaxmodapk.com
|
||||
https://taurine.app
|
||||
https://theodyssey.dev
|
||||
https://www.youjizz.com
|
||||
https://www.eporner.com
|
||||
https://yespornplease.to
|
||||
https://www.splitgate.com
|
||||
https://github.com/tamius-han/ultrawidify
|
||||
https://spyware.neocities.org/articles/index.html
|
||||
https://revolt.chat
|
||||
https://www.cirlos.net
|
||||
https://pdffixer.com
|
||||
https://www.resilio.com/individuals/
|
||||
https://github.com/nerfirelia123/KillSwitch
|
||||
https://github.com/apsun/loliOS
|
||||
https://oxoyo.co/X-WebDesktop-Vue/
|
||||
https://packard-belle.netlify.com
|
||||
https://rahul.io
|
||||
https://whimsy.space
|
||||
https://www.os-js.org
|
||||
https://www.meilisearch.com
|
||||
https://twowi.de
|
||||
https://btcguide.github.io
|
||||
https://fleek.co
|
||||
https://20-things.com
|
||||
https://earth.nullschool.net
|
||||
https://www.docracy.com
|
||||
https://rubular.com
|
||||
https://tangledlines.net/prices
|
||||
https://termible.io
|
||||
https://jotoba.de
|
||||
https://www.tweetgen.com
|
||||
https://danielyxie.github.io/bitburner/
|
||||
https://www.lexicool.com/translate-web-page.asp
|
||||
https://www.loyalfans.com
|
||||
https://justfor.fans
|
||||
https://stars.avn.com
|
||||
https://fancentro.com
|
||||
https://admireme.vip
|
||||
https://www.clips4sale.com
|
||||
https://www.manyvids.com
|
||||
https://chaturbate.com
|
||||
https://www.cam4.com
|
||||
https://copblaster.com
|
||||
https://junrrein.github.io/pdfslicer/
|
||||
https://github.com/torakiki/pdfsam
|
||||
https://github.com/jlongster/absurd-sql
|
||||
https://github.com/talhabw/bunken
|
||||
https://www.aapanel.com
|
||||
https://instant.io
|
||||
https://spotfy.one
|
||||
https://pahe.ph
|
||||
https://www.tfp.is
|
||||
https://sonic-pi.net
|
||||
https://ludotune.com
|
||||
https://crossface.cf
|
||||
https://kira.vercel.app
|
||||
https://pogu.live
|
||||
https://kylo.io
|
||||
https://digdeeper.neocities.org
|
||||
https://endless-sky.github.io
|
||||
https://github.com/Anuken/Mindustry
|
||||
https://github.com/theonedev/onedev
|
||||
https://github.com/jpochyla/psst
|
||||
https://bios-pw.org
|
||||
https://cococut.net
|
||||
https://serenityos.org
|
||||
https://www.thistothat.com
|
||||
https://duedilly.io
|
||||
https://www.buypass.com/ssl/products/acme
|
||||
https://cheapbotsdonequick.com
|
||||
https://github.com/amd64fox/SpotX
|
||||
https://github.com/mollyim/mollyim-android
|
||||
https://either.io
|
||||
https://libreserver.org
|
||||
https://mergefeed.net
|
||||
https://postach.io
|
||||
https://unmark.it
|
||||
https://od.obagg.com
|
||||
https://vidembed.cc
|
||||
https://vidcloud.stream
|
||||
https://linklonk.com
|
||||
https://metamask.io
|
||||
https://mochi.cards
|
||||
https://notegarden.web.app
|
||||
https://github.com/Godofcoffe/FisherMan
|
||||
https://github.com/catamphetamine/captchan
|
||||
https://github.com/Botspot/wor-flasher
|
||||
https://github.com/armosec/kubescape
|
||||
https://github.com/Satsuoni/widevine-l3-guesser
|
||||
https://github.com/zerodytrash/Simple-YouTube-Age-Restriction-Bypass
|
||||
https://github.com/Zackptg5/Wireguard-Pi-Hole-Cloudflared-Unbound-DNSCrypt-VPN-Server
|
||||
https://greasyfork.org/en/scripts/425854-hcaptcha-solver-automatically-solves-hcaptcha-in-browser
|
||||
https://greasyfork.org/en/scripts/430593-recaptcha-solver-automatically-solves-recaptcha-in-browser
|
||||
https://saurabhdaware.github.io/text-to-handwriting/
|
||||
https://sharktastica.co.uk
|
||||
https://openaudible.org
|
||||
https://www.libib.com
|
||||
https://mcaptcha.org
|
||||
https://chrome.google.com/webstore/detail/fck-overlays/ppedokobpbdajgiejhnjfbdjlgobcpkp
|
||||
https://git.teknik.io/Illegal-Services/Illegal_Services
|
||||
https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher
|
||||
https://github.com/AfoninZ/MultiMC5-Cracked
|
||||
https://github.com/iperov/DeepFaceLive
|
||||
https://github.com/r-darwish/topgrade
|
||||
https://www.kryptor.co.uk
|
||||
https://www.onmail.com
|
||||
https://unfollow-monkey.com
|
||||
https://www.sheet-posting.me
|
||||
https://911realtime.org
|
||||
https://trash-guides.info
|
||||
https://github.com/jmir1/aniyomi
|
||||
https://github.com/JustinBeckwith/linkinator
|
||||
https://github.com/seevik2580/tor-ip-changer
|
||||
https://github.com/worldreboot/twitch-reloaded-roku
|
||||
https://huggingface.co/spaces/akhaliq/PaddleOCR
|
||||
https://github.com/zorggish/FractalCryptGUI
|
||||
https://github.com/ExeCsrss/EzWindSLIC
|
||||
https://uncensorablepublishing.com
|
||||
https://www.figmachine.com
|
||||
https://oddsound.com
|
||||
https://www.pointsmaker.com
|
||||
https://www.buyformeretail.com
|
||||
https://www.opendesktop.org
|
||||
https://geonode.com/free-proxy-list
|
||||
https://theintercept.com
|
||||
https://thechive.com
|
||||
https://dns.sb
|
||||
https://vpnapi.io
|
||||
https://themarkup.org/blacklight
|
||||
https://intodns.com
|
||||
https://mycroft.ai
|
||||
https://saymine.com
|
||||
https://bitoff.io
|
||||
https://cryptofibers.com
|
||||
https://github.com/christophetd/CloudFlair
|
||||
https://github.com/HyNetwork/hysteria
|
||||
https://subreply.com
|
||||
https://syagent.com
|
||||
https://www.kvibes.de/mediaelch/
|
||||
https://github.com/Pheeeeenom/fuckigg
|
||||
https://github.com/patzly/doodle-android
|
||||
https://www.epidemicsound.com
|
||||
https://audiotag.info
|
||||
https://otx.alienvault.com
|
||||
https://www.accuradio.com
|
||||
https://fuckoffgoogle.de
|
||||
https://leaked.site
|
||||
https://multiplayerpiano.com
|
||||
https://www.yourworldoftext.com
|
||||
https://computernewb.com/collab-vm/
|
||||
https://docs.google.com/document/d/1t10VI-sccy1CfAeMZHwmCS_7agIHFo_B5ipMjzsMtTg/edit
|
||||
https://web.archive.org/web/20191130224152/https
|
||||
https://archive.fo/eKsNN
|
||||
https://belia.fr
|
||||
https://movie.squeezebox.dev
|
||||
https://breachdirectory.org
|
||||
https://analyze.intezer.com
|
||||
https://elements.envato.com/photos
|
||||
https://gofile.io/d/dPbZxK
|
||||
https://alienmelon.itch.io/electric-file-monitor
|
||||
https://glowmpv.github.io
|
||||
https://github.com/widevinedump
|
||||
https://github.com/umbrae/reddit-top-2.5-million
|
||||
https://stoplookthink.com
|
||||
https://dsruptive.com
|
||||
https://cryptomator.org
|
||||
https://aim400kg.com
|
||||
https://weboas.is/faq/net/#collapseNinetyOne1
|
||||
https://ameliorated.info
|
||||
http://filminator.net
|
||||
http://mikudb.moe
|
||||
https://www.kgay4all.com/seioqueseiporleroqueleio/
|
||||
https://tenami.tv
|
||||
https://github.com/digimezzo/dopamine
|
||||
http://www.digimezzo.com/software/dopamine/
|
||||
https://movies4discord.xyz
|
||||
https://github.com/LagradOst/CloudStream-3
|
||||
https://github.com/nvbn/thefuck
|
||||
https://ask4movie.io
|
||||
https://bae.st
|
||||
https://www.kitploit.com
|
||||
https://exploit.kitploit.com
|
||||
https://flutterawesome.com
|
||||
https://manned.org
|
||||
https://github.com/kermitt2/grobid
|
||||
https://datasetsearch.research.google.com
|
||||
https://www.thefreelibrary.com
|
||||
http://programming-motherfucker.com/
|
||||
https://github.com/costis94/bookcut
|
||||
https://appaudiobooks.com
|
||||
http://loudlit.org
|
||||
https://www.learnoutloud.com/Free-Audiobooks
|
||||
https://audiobookreviews.com
|
||||
https://audiobooklabs.com
|
||||
https://bookaudiobook.com
|
||||
https://hdaudiobooks.com
|
||||
https://tokybook.com
|
||||
https://free-math-resources.netlify.app
|
||||
http://en.parolja.net
|
||||
https://freeaccount.biz
|
||||
http://password-login.com
|
||||
https://void.yt
|
||||
https://www.0wx.org
|
||||
https://www.amputatorbot.com
|
||||
https://sqlizer.io
|
||||
http://scientificmagazines.top
|
||||
https://www.openedition.org
|
||||
https://learncreative.net
|
||||
https://einsteinpapers.press.princeton.edu
|
||||
https://www.physicsforums.com
|
||||
https://rightforge.com
|
||||
https://tabler.one
|
||||
https://how-i-experience-web-today.com
|
||||
https://www.reddit.com/r/downloadleak/
|
||||
https://github.com/twf-nikhila/Awesome-Black-Friday-Cyber-Monday-deals
|
||||
https://www.osinttechniques.com/osint-tools.html
|
||||
https://wpa-sec.stanev.org
|
||||
https://www.zlookup.com
|
||||
https://github.com/jam-systems/jam
|
||||
https://tsurugi-linux.org
|
||||
https://github.com/chris124567/hulu
|
||||
https://thenftbay.org/index.html
|
||||
https://boba.best/services/
|
||||
https://github.com/alievk/avatarify-python
|
||||
https://github.com/openaudible/openaudible
|
||||
https://1text.com/plagiarismchecker
|
||||
https://copyleaks.com
|
||||
https://myassignmenthelp.com/plagiarism-checker.php
|
||||
https://onlineplagiarismchecker.net
|
||||
https://plagiarismcheck.org
|
||||
https://plagiarismcheckerx.com
|
||||
https://plagiarismsearch.com
|
||||
https://pltext.com
|
||||
https://unicheck.com
|
||||
https://writer.com/plagiarism-checker/
|
||||
https://www.duplichecker.com
|
||||
https://www.grammarly.com/plagiarism-checker
|
||||
https://www.plagiarismchecker.co
|
||||
https://www.plagium.com/en/plagiarismchecker
|
||||
https://www.plagscan.com
|
||||
https://www.quetext.com
|
||||
https://github.com/kaputnikGo/PilferShushJammer
|
||||
https://app.netlify.com/drop
|
||||
https://regexlearn.com
|
||||
https://www.appflowy.io
|
||||
https://fosscord.com
|
||||
https://fasthub.net
|
||||
https://openmpt.org
|
||||
https://github.com/olive-editor/olive
|
||||
https://liveweave.com
|
||||
https://runyourown.social
|
||||
https://www.w3schools.com/spaces/
|
||||
https://www.boredbutton.com
|
||||
https://theforest.link
|
||||
https://pollcode.com
|
||||
https://www.proboards.com
|
||||
https://dropall.stream
|
||||
https://www.youtube.com/watch?v=sc9OjL6Mjqo
|
||||
https://twitter.com/demon_saw
|
||||
https://www.ventoy.net/en/index.html
|
||||
https://ichi.city
|
||||
https://austinhuang.me/matrix-homeservers.html#list
|
||||
https://tatsumoto-ren.github.io/blog/list-of-matrix-servers.html
|
||||
https://youtube.com/watch?v=3g-J4dar11k
|
||||
https://github.com/Makeshift/Marauder
|
||||
https://vtuner.com/setupapp/guide/asp/BrowseStations/startpage.asp
|
||||
https://observatory.mozilla.org
|
||||
https://www.ssllabs.com/ssltest/
|
||||
https://onionshare.org
|
||||
https://toffeeshare.com
|
||||
https://miau.sadgrl.online/websurfer/
|
||||
http://jpfo.org
|
||||
https://cozy.tv
|
||||
https://nitter.net/DairyQu13037415/status/1450988468058869762#m
|
||||
https://id-ransomware.malwarehunterteam.com
|
||||
https://handbook.vantage.sh
|
||||
https://news.t0.vc
|
||||
https://www.youtube.com/watch?v=RMXViPlehAo
|
||||
https://www.geeky-gadgets.com/raspberry-pi-blade-cm4-05-08-2021/
|
||||
https://pibox.io
|
||||
https://www.freetogame.com
|
||||
https://incogsnoo.com
|
||||
https://jami.net
|
||||
https://foundryvtt.com/packages/jitsirtc/
|
||||
https://jitsi.org
|
||||
https://github.com/m1k1o/neko
|
||||
https://www.jwz.org
|
||||
https://github.com/johnjago/awesome-uncopyright
|
||||
https://duckduckgo.com/tty/
|
||||
https://animixplay.to
|
||||
https://youtu.be/v8ouDk2Mayw
|
||||
https://www.immunaband.com
|
||||
https://ripped.guide
|
||||
https://peakd.com
|
||||
https://podtail.com
|
||||
https://www.youtube.com/watch?v=VT2L1SXFq9U
|
||||
https://halome.nu
|
||||
https://youtu.be/KeJrv3DSPZs
|
||||
https://blog.cloudflare.com/get-started-web3
|
||||
https://slidesharedownloader.ngelmat.net
|
||||
https://github.com/nbats/FMHYedit
|
||||
https://web.archive.org/web/20211007001100/https
|
||||
https://archive.is/cfEHy
|
||||
https://tartube.sourceforge.io
|
||||
https://kaizoku.dev/double-blind-passwords-aka-horcruxing
|
||||
https://www.twitchearnings.com
|
||||
https://dpaste.org/MvoM
|
||||
https://github.com/DataSploit/datasploit
|
||||
https://pomfcrawl.pythonanywhere.com
|
||||
https://5e.tools
|
15
weboasis/alerts/toastify.min.css
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Minified by jsDelivr using clean-css v4.2.3.
|
||||
* Original file: /npm/toastify-js@1.11.2/src/toastify.css
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
/*!
|
||||
* Toastify js 1.11.2
|
||||
* https://github.com/apvarun/toastify-js
|
||||
* @license MIT licensed
|
||||
*
|
||||
* Copyright (C) 2018 Varun A P
|
||||
*/
|
||||
.toastify{padding:12px 20px;color:#fff;display:inline-block;box-shadow:0 3px 6px -1px rgba(0,0,0,.12),0 10px 36px -4px rgba(77,96,232,.3);background:-webkit-linear-gradient(315deg,#73a5ff,#5477f5);background:linear-gradient(135deg,#73a5ff,#5477f5);position:fixed;opacity:0;transition:all .4s cubic-bezier(.215,.61,.355,1);border-radius:2px;cursor:pointer;text-decoration:none;max-width:calc(50% - 20px);z-index:2147483647}.toastify.on{opacity:1}.toast-close{opacity:.4;padding:0 5px}.toastify-right{right:15px}.toastify-left{left:15px}.toastify-top{top:-150px}.toastify-bottom{bottom:-150px}.toastify-rounded{border-radius:25px}.toastify-avatar{width:1.5em;height:1.5em;margin:-7px 5px;border-radius:2px}.toastify-center{margin-left:auto;margin-right:auto;left:0;right:0;max-width:fit-content;max-width:-moz-fit-content}@media only screen and (max-width:360px){.toastify-left,.toastify-right{margin-left:auto;margin-right:auto;left:0;right:0;max-width:fit-content}}
|
||||
/*# sourceMappingURL=/sm/2c1d86ef781a8729121a663078ba5f05b587d93551069e4f9eaafa3659145e39.map */
|
1
weboasis/alerts/toastify.min.js
vendored
Normal file
5
weboasis/arcade/3dcity/_compile/build.bat
Normal file
@ -0,0 +1,5 @@
|
||||
python build.py --include city.3d --output ../build/city.3d.js
|
||||
python build.py --include city.3d --minify --output ../build/city.3d.min.js
|
||||
|
||||
python build.py --include view --output ../build/view.js
|
||||
python build.py --include view --minify --output ../build/view.min.js
|
96
weboasis/arcade/3dcity/_compile/build.py
Normal file
@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
|
||||
if sys.version_info < (2, 7):
|
||||
print("This script requires at least Python 2.7.")
|
||||
print("Please, update to a newer version: http://www.python.org/download/releases/")
|
||||
exit()
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
def make_parent_directories_if_needed(filepath):
|
||||
parent_directory = os.path.dirname(os.path.realpath(filepath))
|
||||
try:
|
||||
os.makedirs(parent_directory)
|
||||
except OSError:
|
||||
pass # nothing to do
|
||||
|
||||
def main(argv=None):
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--include', action='append', required=True)
|
||||
parser.add_argument('--externs', action='append', default=['common.js'])
|
||||
parser.add_argument('--amd', action='store_true', default=False)
|
||||
parser.add_argument('--minify', action='store_true', default=False)
|
||||
parser.add_argument('--output', default='')
|
||||
parser.add_argument('--sourcemaps', action='store_true', default=False)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
output = args.output
|
||||
make_parent_directories_if_needed(output) # necessary
|
||||
|
||||
# merge
|
||||
|
||||
print(' * Building ' + output)
|
||||
|
||||
# enable sourcemaps support
|
||||
|
||||
if args.sourcemaps:
|
||||
sourcemap = output + '.map'
|
||||
sourcemapping = '\n//@ sourceMappingURL=' + sourcemap
|
||||
sourcemapargs = ' --create_source_map ' + sourcemap + ' --source_map_format=V3'
|
||||
else:
|
||||
sourcemap = sourcemapping = sourcemapargs = ''
|
||||
|
||||
fd, path = tempfile.mkstemp()
|
||||
tmp = open(path, 'w')
|
||||
sources = []
|
||||
|
||||
if args.amd:
|
||||
tmp.write('( function ( root, factory ) {\n\n\tif ( typeof define === \'function\' && define.amd ) {\n\n\t\tdefine( [ \'exports\' ], factory );\n\n\t} else if ( typeof exports === \'object\' ) {\n\n\t\tfactory( exports );\n\n\t} else {\n\n\t\tfactory( root );\n\n\t}\n\n}( this, function ( exports ) {\n\n')
|
||||
|
||||
for include in args.include:
|
||||
with open( include + '.json','r') as f:
|
||||
files = json.load(f)
|
||||
for filename in files:
|
||||
filename = '../' + filename;
|
||||
sources.append(filename)
|
||||
with open(filename, 'r') as f:
|
||||
tmp.write(f.read())
|
||||
tmp.write('\n')
|
||||
|
||||
if args.amd:
|
||||
tmp.write('exports.UIL = UIL;\n\n} ) );')
|
||||
|
||||
tmp.close()
|
||||
|
||||
# save
|
||||
|
||||
if args.minify is False:
|
||||
shutil.copy(path, output)
|
||||
os.chmod(output, 0o664); # temp files would usually get 0600
|
||||
|
||||
else:
|
||||
|
||||
externs = ' --externs '.join(args.externs)
|
||||
source = ' '.join(sources)
|
||||
cmd = 'java -jar c.jar --warning_level=VERBOSE --jscomp_off=globalThis --externs %s --jscomp_off=checkTypes --language_in=ECMASCRIPT5_STRICT --js %s --js_output_file %s %s' % (externs, source, output, sourcemapargs)
|
||||
os.system(cmd)
|
||||
|
||||
# header
|
||||
|
||||
with open(output,'r') as f: text = f.read()
|
||||
with open(output,'w') as f: f.write(text + sourcemapping)
|
||||
|
||||
os.close(fd)
|
||||
os.remove(path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
BIN
weboasis/arcade/3dcity/_compile/c.jar
Normal file
63
weboasis/arcade/3dcity/_compile/city.3d.json
Normal file
@ -0,0 +1,63 @@
|
||||
[
|
||||
"src/Micro.js",
|
||||
"src/Random.js",
|
||||
"src/Direction.js",
|
||||
"src/Messages.js",
|
||||
"src/MessageManager.js",
|
||||
"src/Text.js",
|
||||
"src/Census.js",
|
||||
"src/Evaluation.js",
|
||||
"src/Budget.js",
|
||||
"src/Valves.js",
|
||||
"src/Tile.js",
|
||||
"src/PositionMaker.js",
|
||||
"src/GameMap.js",
|
||||
"src/MapGenerator.js",
|
||||
|
||||
"src/utils/TileUtils.js",
|
||||
"src/utils/ZoneUtils.js",
|
||||
"src/utils/SpriteUtils.js",
|
||||
"src/utils/BlockMapUtils.js",
|
||||
|
||||
"src/zone/Residential.js",
|
||||
"src/zone/Commercial.js",
|
||||
"src/zone/Industrial.js",
|
||||
"src/zone/MiscTiles.js",
|
||||
"src/zone/Road.js",
|
||||
"src/zone/Stadia.js",
|
||||
"src/zone/EmergencyServices.js",
|
||||
"src/zone/Transport.js",
|
||||
|
||||
"src/tool/WorldEffects.js",
|
||||
"src/tool/BaseTool.js",
|
||||
"src/tool/BaseToolConnector.js",
|
||||
"src/tool/ParkTool.js",
|
||||
"src/tool/BulldozerTool.js",
|
||||
"src/tool/BuildingTool.js",
|
||||
"src/tool/RailTool.js",
|
||||
"src/tool/WireTool.js",
|
||||
"src/tool/RoadTool.js",
|
||||
"src/tool/QueryTool.js",
|
||||
"src/tool/GameTools.js",
|
||||
|
||||
"src/sprite/BaseSprite.js",
|
||||
"src/sprite/TrainSprite.js",
|
||||
"src/sprite/AirplaneSprite.js",
|
||||
"src/sprite/BoatSprite.js",
|
||||
"src/sprite/CopterSprite.js",
|
||||
"src/sprite/ExplosionSprite.js",
|
||||
"src/sprite/MonsterSprite.js",
|
||||
"src/sprite/TornadoSprite.js",
|
||||
"src/sprite/SpriteManager.js",
|
||||
|
||||
"src/game/MapScanner.js",
|
||||
"src/game/PowerManager.js",
|
||||
"src/game/RepairManager.js",
|
||||
"src/game/DisasterManager.js",
|
||||
"src/game/InputStatus.js",
|
||||
"src/game/Traffic.js",
|
||||
"src/game/TileHistory.js",
|
||||
"src/game/AnimationManager.js",
|
||||
"src/game/BlockMap.js",
|
||||
"src/game/Simulation.js"
|
||||
]
|
2
weboasis/arcade/3dcity/_compile/common.js
Normal file
@ -0,0 +1,2 @@
|
||||
var console;
|
||||
var JSON;
|
6
weboasis/arcade/3dcity/_compile/view.json
Normal file
@ -0,0 +1,6 @@
|
||||
[
|
||||
"src3d/main.js",
|
||||
"src3d/view3d.js",
|
||||
"src3d/hub.js",
|
||||
"src3d/ImprovedNoise.js"
|
||||
]
|
7749
weboasis/arcade/3dcity/build/city.3d.js
Normal file
252
weboasis/arcade/3dcity/build/city.3d.min.js
vendored
Normal file
@ -0,0 +1,252 @@
|
||||
'use strict';var Micro={speedPowerScan:[2,4,5],speedPollutionTerrainLandValueScan:[2,7,17],speedCrimeScan:[1,8,18],speedPopulationDensityScan:[1,9,19],speedFireAnalysis:[1,10,20],CENSUS_FREQUENCY_10:4};Micro.CENSUS_FREQUENCY_120=10*Micro.CENSUS_FREQUENCY_10;Micro.TAX_FREQUENCY=48;Micro.MAP_WIDTH=128;Micro.MAP_HEIGHT=128;Micro.MAP_DEFAULT_WIDTH=3*Micro.MAP_WIDTH;Micro.MAP_DEFAULT_HEIGHT=3*Micro.MAP_HEIGHT;Micro.MAP_BIG_DEFAULT_WIDTH=16*Micro.MAP_WIDTH;Micro.MAP_BIG_DEFAULT_HEIGHT=16*Micro.MAP_HEIGHT;
|
||||
Micro.MAP_BIG_DEFAULT_ID="bigMap";Micro.MAP_PARENT_ID="splashContainer";Micro.MAP_DEFAULT_ID="SplashCanvas";Micro.DEFAULT_WIDTH=400;Micro.DEFAULT_HEIGHT=400;Micro.DEFAULT_ID="MicropolisCanvas";Micro.RCI_DEFAULT_ID="RCICanvas";Micro.arrs="res com ind crime money pollution".split(" ");var M_ARRAY_TYPE;M_ARRAY_TYPE||(M_ARRAY_TYPE="undefined"!==typeof Float32Array?Float32Array:Array);Micro.clamp=function(a,b,c){return a<b?b:a>c?c:a};
|
||||
Micro.makeConstantDescriptor=function(a){return{configurable:!1,enumerable:!1,writeable:!1,value:a}};Micro.rotate10Arrays=function(){for(var a=0;a<Micro.arrs.length;a++){var b=Micro.arrs[a]+"Hist10";this[b].pop();this[b].unshift(0)}};Micro.rotate120Arrays=function(){for(var a=0;a<Micro.arrs.length;a++){var b=Micro.arrs[a]+"Hist120";this[b].pop();this[b].unshift(0)}};Micro.isCallable=function(a){return"function"===typeof a};Micro.LEVEL_EASY=0;Micro.LEVEL_MED=1;Micro.LEVEL_HARD=2;
|
||||
Micro.SPEED_PAUSED=0;Micro.SPEED_SLOW=1;Micro.SPEED_MED=2;Micro.SPEED_FAST=3;Micro.ROUTE_FOUND=1;Micro.NO_ROUTE_FOUND=0;Micro.NO_ROAD_FOUND=-1;Micro.MAX_TRAFFIC_DISTANCE=30;Micro.perimX=[-1,0,1,2,2,2,1,0,-1,-2,-2,-2];Micro.perimY=[-2,-2,-2,-1,0,1,2,2,2,1,0,-1];Micro.SPRITE_TRAIN=1;Micro.SPRITE_HELICOPTER=2;Micro.SPRITE_AIRPLANE=3;Micro.SPRITE_SHIP=4;Micro.SPRITE_MONSTER=5;Micro.SPRITE_TORNADO=6;Micro.SPRITE_EXPLOSION=7;Micro.CC_VILLAGE="VILLAGE";Micro.CC_TOWN="TOWN";Micro.CC_CITY="CITY";
|
||||
Micro.CC_CAPITAL="CAPITAL";Micro.CC_METROPOLIS="METROPOLIS";Micro.CC_MEGALOPOLIS="MEGALOPOLIS";Micro.CRIME=0;Micro.POLLUTION=1;Micro.HOUSING=2;Micro.TAXES=3;Micro.TRAFFIC=4;Micro.UNEMPLOYMENT=5;Micro.FIRE=6;Micro.RES_VALVE_RANGE=2E3;Micro.COM_VALVE_RANGE=1500;Micro.IND_VALVE_RANGE=1500;Micro.taxTable=[200,150,120,100,80,50,30,0,-10,-40,-100,-150,-200,-250,-300,-350,-400,-450,-500,-550,-600];Micro.extMarketParamTable=[1.2,1.1,0.98];Micro.RLevels=[0.7,0.9,1.2];Micro.FLevels=[1.4,1.2,0.8];
|
||||
Micro.MAX_ROAD_EFFECT=32;Micro.MAX_POLICESTATION_EFFECT=1E3;Micro.MAX_FIRESTATION_EFFECT=1E3;Micro.COAL_POWER_STRENGTH=700;Micro.NUCLEAR_POWER_STRENGTH=2E3;Micro.DISASTER_NONE="None";Micro.DISASTER_MONSTER="Monster";Micro.DISASTER_FIRE="Fire";Micro.DISASTER_FLOOD="Flood";Micro.DISASTER_CRASH="Crash";Micro.DISASTER_MELTDOWN="Meltdown";Micro.DISASTER_TORNADO="Tornado";Micro.CURRENT_VERSION=3;Micro.KEY="micropolisJSGame";Micro.lerp=function(a,b,c){return a+(b-a)*c};Micro.rand=function(a,b){return Micro.lerp(a,b,Math.random())};Micro.randInt=function(a,b,c){return 1*Micro.lerp(a,b,Math.random()).toFixed(c||0)};Micro.Random=function(){};
|
||||
Micro.Random.prototype={constructor:Micro.Random,getChance:function(a){return 0===(this.getRandom16()&a)},getERandom:function(a){var b=this.getRandom(a);a=this.getRandom(a);return Math.min(b,a)},getRandom:function(a){return Math.floor(Math.random()*(a+1))},getRandom16:function(){return this.getRandom(65535)},getRandom16Signed:function(){var a=this.getRandom16();32768<=a&&(a=32768-a);return a}};var Random=new Micro.Random;Micro.Direction=function(){};
|
||||
Micro.Direction.prototype={constructor:Micro.Direction,INVALID:-1,NORTH:0,NORTHEAST:1,EAST:2,SOUTHEAST:3,SOUTH:4,SOUTHWEST:5,WEST:6,NORTHWEST:7,BEGIN:0,END:8,increment45:function(a,b){if(1>arguments.length)throw new TypeError;if(a==this.INVALID)return a;b||0===b||(b=1);return a+b},increment90:function(a){if(1>arguments.length)throw new TypeError;return this.increment45(a,2)},rotate45:function(a,b){if(1>arguments.length)throw new TypeError;if(a==this.INVALID)return a;b||0===b||(b=1);return(a-this.NORTH+
|
||||
b&7)+this.NORTH},rotate90:function(a){if(1>arguments.length)throw new TypeError;return this.rotate45(a,2)},rotate180:function(a){if(1>arguments.length)throw new TypeError;return this.rotate45(a,4)}};var Direction=new Micro.Direction;var messageData={AUTOBUDGET_CHANGED:Micro.makeConstantDescriptor("Autobudget changed"),BUDGET_NEEDED:Micro.makeConstantDescriptor("User needs to budget"),BLACKOUTS_REPORTED:Micro.makeConstantDescriptor("Blackouts reported"),DATE_UPDATED:Micro.makeConstantDescriptor("Date changed"),DID_TOOL:Micro.makeConstantDescriptor("Tool applied"),EARTHQUAKE:Micro.makeConstantDescriptor("Earthquake"),EXPLOSION_REPORTED:Micro.makeConstantDescriptor("Explosion Reported"),EVAL_UPDATED:Micro.makeConstantDescriptor("Evaluation Updated"),
|
||||
FIRE_REPORTED:Micro.makeConstantDescriptor("Fire!"),FIRE_STATION_NEEDS_FUNDING:Micro.makeConstantDescriptor("Fire station needs funding"),FLOODING_REPORTED:Micro.makeConstantDescriptor("Flooding reported"),FUNDS_CHANGED:Micro.makeConstantDescriptor("Total funds has changed"),HEAVY_TRAFFIC:Micro.makeConstantDescriptor("Total funds has changed"),HELICOPTER_CRASHED:Micro.makeConstantDescriptor("Helicopter crashed"),HIGH_CRIME:Micro.makeConstantDescriptor("High crime"),HIGH_POLLUTION:Micro.makeConstantDescriptor("High pollution"),
|
||||
MONSTER_SIGHTED:Micro.makeConstantDescriptor("Monster sighted"),NEED_ELECTRICITY:Micro.makeConstantDescriptor("More power needed"),NEED_FIRE_STATION:Micro.makeConstantDescriptor("Fire station needed"),NEED_MORE_COMMERCIAL:Micro.makeConstantDescriptor("More commercial zones needed"),NEED_MORE_INDUSTRIAL:Micro.makeConstantDescriptor("More industrial zones needed"),NEED_MORE_RESIDENTIAL:Micro.makeConstantDescriptor("More residential needed"),NEED_MORE_RAILS:Micro.makeConstantDescriptor("More railways needed"),
|
||||
NEED_MORE_ROADS:Micro.makeConstantDescriptor("More roads needed"),NEED_POLICE_STATION:Micro.makeConstantDescriptor("Police station needed"),NEED_AIRPORT:Micro.makeConstantDescriptor("Airport needed"),NEED_SEAPORT:Micro.makeConstantDescriptor("Seaport needed"),NEED_STADIUM:Micro.makeConstantDescriptor("Stadium needed"),NO_MONEY:Micro.makeConstantDescriptor("No money"),NOT_ENOUGH_POWER:Micro.makeConstantDescriptor("Not enough power"),NUCLEAR_MELTDOWN:Micro.makeConstantDescriptor("Nuclear Meltdown"),
|
||||
PLANE_CRASHED:Micro.makeConstantDescriptor("Plane crashed"),POLICE_NEEDS_FUNDING:Micro.makeConstantDescriptor("Police need funding"),QUERY_WINDOW_NEEDED:Micro.makeConstantDescriptor("Query window needed"),REACHED_CAPITAL:Micro.makeConstantDescriptor("Now a capital"),REACHED_CITY:Micro.makeConstantDescriptor("Now a city"),REACHED_METROPOLIS:Micro.makeConstantDescriptor("Now a metropolis"),REACHED_MEGALOPOLIS:Micro.makeConstantDescriptor("Now a megalopolis"),REACHED_TOWN:Micro.makeConstantDescriptor("Now a town"),
|
||||
REACHED_VILLAGE:Micro.makeConstantDescriptor("Now a village"),ROAD_NEEDS_FUNDING:Micro.makeConstantDescriptor("Roads need funding"),SHIP_CRASHED:Micro.makeConstantDescriptor("Shipwrecked"),SOUND_EXPLOSIONHIGH:Micro.makeConstantDescriptor("Explosion! Bang!"),SOUND_EXPLOSIONLOW:Micro.makeConstantDescriptor("Explosion! Bang!"),SOUND_HEAVY_TRAFFIC:Micro.makeConstantDescriptor("Heavy Traffic sound"),SOUND_HONKHONK:Micro.makeConstantDescriptor("HonkHonk sound"),SOUND_MONSTER:Micro.makeConstantDescriptor("Monster sound"),
|
||||
TAX_TOO_HIGH:Micro.makeConstantDescriptor("Tax too high"),TORNADO_SIGHTED:Micro.makeConstantDescriptor("Tornado sighted"),TRAFFIC_JAMS:Micro.makeConstantDescriptor("Traffic jams reported"),TRAIN_CRASHED:Micro.makeConstantDescriptor("Train crashed"),VALVES_UPDATED:Micro.makeConstantDescriptor("Valves updated"),WELCOME:Micro.makeConstantDescriptor("Welcome to 3D city"),WELCOMEBACK:Micro.makeConstantDescriptor("Welcome back to your 3D city")},Messages=Object.defineProperties({},messageData);Micro.MessageManager=function(){this.data=[]};Micro.MessageManager.prototype={constructor:Micro.MessageManager,sendMessage:function(a,b){this.data.push({message:a,data:b})},clear:function(){this.data=[]},getMessages:function(){return this.data.slice()}};Micro.Text=function(){var a={};a[""+Micro.LEVEL_EASY]="Easy";a[""+Micro.LEVEL_MED]="Medium";a[""+Micro.LEVEL_HARD]="Hard";var b={};b[Micro.CC_VILLAGE]="VILLAGE";b[Micro.CC_TOWN]="TOWN";b[Micro.CC_CITY]="CITY";b[Micro.CC_CAPITAL]="CAPITAL";b[Micro.CC_METROPOLIS]="METROPOLIS";b[Micro.CC_MEGALOPOLIS]="MEGALOPOLIS";var c={};c[Micro.CRIME]="Crime";c[Micro.POLLUTION]="Pollution";c[Micro.HOUSING]="Housing";c[Micro.TAXES]="Taxes";c[Micro.TRAFFIC]="Traffic";c[Micro.UNEMPLOYMENT]="Unemployment";c[Micro.FIRE]=
|
||||
"Fire";var d={};d[Messages.FIRE_STATION_NEEDS_FUNDING]="Fire departments need funding";d[Messages.NEED_AIRPORT]="Commerce requires an Airport";d[Messages.NEED_FIRE_STATION]="Citizens demand a Fire Department";d[Messages.NEED_ELECTRICITY]="Build a Power Plant";d[Messages.NEED_MORE_INDUSTRIAL]="More industrial zones needed";d[Messages.NEED_MORE_COMMERCIAL]="More commercial zones needed";d[Messages.NEED_MORE_RESIDENTIAL]="More residential zones needed";d[Messages.NEED_MORE_RAILS]="Inadequate rail system";
|
||||
d[Messages.NEED_MORE_ROADS]="More roads required";d[Messages.NEED_POLICE_STATION]="Citizens demand a Police Department";d[Messages.NEED_SEAPORT]="Industry requires a Sea Port";d[Messages.NEED_STADIUM]="Residents demand a Stadium";d[Messages.ROAD_NEEDS_FUNDING]="Roads deteriorating, due to lack of funds";d[Messages.POLICE_NEEDS_FUNDING]="Police departments need funding";d[Messages.WELCOME]="Welcome to 3D City";d[Messages.WELCOMEBACK]="Welcome to 3D City";var e={};e[Messages.BLACKOUTS_REPORTED]="Brownouts, build another Power Plant";
|
||||
e[Messages.COPTER_CRASHED]="A helicopter crashed ";e[Messages.EARTHQUAKE]="Major earthquake reported !!";e[Messages.EXPLOSION_REPORTED]="Explosion detected ";e[Messages.FLOODING_REPORTED]="Flooding reported !";e[Messages.FIRE_REPORTED]="Fire reported ";e[Messages.HEAVY_TRAFFIC]="Heavy Traffic reported";e[Messages.HIGH_CRIME]="Crime very high";e[Messages.HIGH_POLLUTION]="Pollution very high";e[Messages.MONSTER_SIGHTED]="A Monster has been sighted !";e[Messages.NO_MONEY]="YOUR CITY HAS GONE BROKE";
|
||||
e[Messages.NOT_ENOUGH_POWER]="Blackouts reported. insufficient power capacity";e[Messages.NUCLEAR_MELTDOWN]="A Nuclear Meltdown has occurred !!";e[Messages.PLANE_CRASHED]="A plane has crashed ";e[Messages.SHIP_CRASHED]="Shipwreck reported ";e[Messages.TAX_TOO_HIGH]="Citizens upset. The tax rate is too high";e[Messages.TORNADO_SIGHTED]="Tornado reported !";e[Messages.TRAFFIC_JAMS]="Frequent traffic jams reported";e[Messages.TRAIN_CRASHED]="A train crashed ";return{badMessages:e,cityClass:b,crimeStrings:["Safe",
|
||||
"Light","Moderate","Dangerous"],densityStrings:["Low","Medium","High","Very High"],gameLevel:a,goodMessages:" {}",landValueStrings:["Slum","Lower Class","Middle Class","High"],months:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),neutralMessages:d,problems:c,pollutionStrings:["None","Moderate","Heavy","Very Heavy"],rateStrings:["Declining","Stable","Slow Growth","Fast Growth"],toolMessages:{noMoney:"Insufficient funds to build that",needsDoze:"Area must be bulldozed first"},zoneTypes:"Clear;Water;Trees;Rubble;Flood;Radioactive Waste;Fire;Road;Power;Rail;Residential;Commercial;Industrial;Seaport;Airport;Coal Power;Fire Department;Police Department;Stadium;Nuclear Power;Draw Bridge;Radar Dish;Fountain;Industrial;Steelers 38 Bears 3;Draw Bridge;Ur 238".split(";")}};
|
||||
var TXT=new Micro.Text;Micro.CensusProps="resPop comPop indPop crimeRamp pollutionRamp landValueAverage pollutionAverage crimeAverage totalPop resHist10 resHist120 comHist10 comHist120 indHist10 indHist120 crimeHist10 crimeHist120 moneyHist10 moneyHist120 pollutionHist10 pollutionHist120".split(" ");
|
||||
Micro.Census=function(){this.clearCensus();this.changed=!1;for(var a=this.totalPop=this.crimeAverage=this.pollutionAverage=this.landValueAverage=this.pollutionRamp=this.crimeRamp=0;a<Micro.arrs.length;a++){var b=Micro.arrs[a]+"Hist120",c=Micro.arrs[a]+"Hist10";this[c]=[];for(var d=120;d--;)this[c][d]=0;this[b]=[];for(c=120;c--;)this[b][c]=0}};
|
||||
Micro.Census.prototype={constructor:Micro.Census,save:function(a){for(var b=0,c=Micro.CensusProps.length;b<c;b++)a[Micro.CensusProps[b]]=this[Micro.CensusProps[b]]},load:function(a){for(var b=0,c=Micro.CensusProps.length;b<c;b++)this[Micro.CensusProps[b]]=a[Micro.CensusProps[b]]},clearCensus:function(){this.airportPop=this.seaportPop=this.nuclearPowerPop=this.coalPowerPop=this.stadiumPop=this.fireStationPop=this.policeStationPop=this.churchPop=this.hospitalPop=this.indZonePop=this.comZonePop=this.resZonePop=
|
||||
this.indPop=this.comPop=this.resPop=this.railTotal=this.roadTotal=this.firePop=this.unpoweredZoneCount=this.poweredZoneCount=0},take10Census:function(a){Micro.rotate10Arrays.call(this);this.resHist10[0]=Math.floor(this.resPop/8);this.comHist10[0]=this.comPop;this.indHist10[0]=this.indPop;this.crimeRamp+=Math.floor((this.crimeAverage-this.crimeRamp)/4);this.crimeHist10[0]=Math.min(this.crimeRamp,255);this.pollutionRamp+=Math.floor((this.pollutionAverage-this.pollutionRamp)/4);this.pollutionHist10[0]=
|
||||
Math.min(this.pollutionRamp,255);this.moneyHist10[0]=Micro.clamp(Math.floor(a.cashFlow/20)+128,0,255);this.hospitalPop<this.resPopScaled?this.needHospital=1:this.hospitalPop>this.resPopScaled?this.needHospital=-1:this.hospitalPop===this.resPopScaled&&(this.needHospital=0);this.changed=!0},take120Census:function(){Micro.rotate120Arrays.call(this);this.resHist120[0]=Math.floor(this.resPop/8);this.comHist120[0]=this.comPop;this.indHist120[0]=this.indPop;this.crimeHist120[0]=this.crimeHist10[0];this.pollutionHist120[0]=
|
||||
this.pollutionHist10[0];this.moneyHist120[0]=this.moneyHist10[0];this.changed=!0}};Micro.PROBLEMS="CVP_CRIME CVP_POLLUTION CVP_HOUSING CVP_TAXES CVP_TRAFFIC CVP_UNEMPLOYMENT CVP_FIRE".split(" ");Micro.NUMPROBLEMS=Micro.PROBLEMS.length;Micro.NUM_COMPLAINTS=4;Micro.EvalProps=["cityClass","cityScore"];Micro.getTrafficAverage=function(a){var b=a.trafficDensityMap;a=a.landValueMap;for(var c=0,d=1,e=0;e<a.gameMapWidth;e+=a.blockSize)for(var f=0;f<a.gameMapHeight;f+=a.blockSize)0<a.worldGet(e,f)&&(c+=b.worldGet(e,f),d++);return 2.4*Math.floor(c/d)};
|
||||
Micro.getUnemployment=function(a){var b=8*(a.comPop+a.indPop);if(0===b)return 0;b=Math.round(255*(a.resPop/b-1));return Math.min(b,255)};Micro.getFireSeverity=function(a){return Math.min(5*a.firePop,255)};Micro.Evaluation=function(a,b){this.sim=b;this.problemVotes=[];this.problemOrder=[];this.evalInit();this.gameLevel=""+a;this.changed=!1};
|
||||
Micro.Evaluation.prototype={constructor:Micro.Evaluation,save:function(a){for(var b=0,c=Micro.EvalProps.length;b<c;b++)a[Micro.EvalProps[b]]=this[Micro.EvalProps[b]]},load:function(a){for(var b=0,c=Micro.EvalProps.length;b<c;b++)this[Micro.EvalProps[b]]=a[Micro.EvalProps[b]]},cityEvaluation:function(){var a=this.sim.census;if(0<a.totalPop){for(var b=[],c=0;c<Micro.NUMPROBLEMS;c++)b.push(0);this.getAssessedValue(a);this.doPopNum(a);this.doProblems(this.sim.census,this.sim.budget,this.sim.blockMaps,
|
||||
b);this.getScore(b);this.doVotes()}else this.evalInit(),this.cityYes=50;this.changeEval()},evalInit:function(){this.cityAssessedValue=this.cityPopDelta=this.cityPop=this.cityYes=0;this.cityClass=Micro.CC_VILLAGE;this.cityScore=500;for(var a=this.cityScoreDelta=0;a<Micro.NUMPROBLEMS;a++)this.problemVotes[a]=0;for(a=0;a<Micro.NUM_COMPLAINTS;a++)this.problemOrder[a]=Micro.NUMPROBLEMS},getAssessedValue:function(a){var b;b=5*a.roadTotal;b+=10*a.railTotal;b+=1E3*a.policeStationPop;b+=1E3*a.fireStationPop;
|
||||
b+=400*a.hospitalPop;b+=3E3*a.stadiumPop;b+=5E3*a.seaportPop;b+=1E4*a.airportPop;b+=3E3*a.coalPowerPop;b+=6E3*a.nuclearPowerPop;this.cityAssessedValue=1E3*b},getPopulation:function(a){return 20*(a.resPop+8*(a.comPop+a.indPop))},doPopNum:function(a){var b=this.cityPop;this.cityPop=this.getPopulation(a);-1==b&&(b=this.cityPop);this.cityPopDelta=this.cityPop-b;this.cityClass=this.getCityClass(this.cityPop)},getCityClass:function(a){this.cityClassification=Micro.CC_VILLAGE;2E3<a&&(this.cityClassification=
|
||||
Micro.CC_TOWN);1E4<this.cityPopulation&&(this.cityClassification=Micro.CC_CITY);5E4<this.cityPopulation&&(this.cityClassification=Micro.CC_CAPITAL);1E5<this.cityPopulation&&(this.cityClassification=Micro.CC_METROPOLIS);5E5<this.cityPopulation&&(this.cityClassification=Micro.CC_MEGALOPOLIS);return this.cityClassification},voteProblems:function(a){for(var b=0;b<Micro.NUMPROBLEMS;b++)this.problemVotes[b]=0;for(var c=b=0,d=0;100>c&&600>d;)Random.getRandom(300)<a[b]&&(this.problemVotes[b]++,c++),b++,b>
|
||||
Micro.NUMPROBLEMS&&(b=0),d++},doProblems:function(a,b,c,d){for(var e=[],f=0;f<Micro.NUMPROBLEMS;f++)e[f]=!1,d[f]=0;d[Micro.CRIME]=a.crimeAverage;d[Micro.POLLUTION]=a.pollutionAverage;d[Micro.HOUSING]=7*a.landValueAverage/10;d[Micro.TAXES]=10*b.cityTax;d[Micro.TRAFFIC]=Micro.getTrafficAverage(c);d[Micro.UNEMPLOYMENT]=Micro.getUnemployment(a);d[Micro.FIRE]=Micro.getFireSeverity(a);this.voteProblems(d);for(f=0;f<Micro.NUM_COMPLAINTS;f++){a=0;b=Micro.NUMPROBLEMS;for(c=0;c<Micro.NUMPROBLEMS;c++)this.problemVotes[c]>
|
||||
a&&!e[c]&&(b=c,a=this.problemVotes[c]);this.problemOrder[f]=b;b<Micro.NUMPROBLEMS&&(e[b]=!0)}},getScore:function(a){var b=this.sim.census,c=this.sim.budget,d=this.sim.valves,e;e=this.cityScore;for(var f=0,g=0;g<Micro.NUMPROBLEMS;g++)f+=a[g];f=Math.floor(f/3);f=Math.min(f,256);f=Micro.clamp(4*(256-f),0,1E3);d.resCap&&(f=Math.round(0.85*f));d.comCap&&(f=Math.round(0.85*f));d.indCap&&(f=Math.round(0.85*f));c.roadEffect<c.MAX_ROAD_EFFECT&&(f-=c.MAX_ROAD_EFFECT-c.roadEffect);c.policeEffect<c.MAX_POLICE_STATION_EFFECT&&
|
||||
(f=Math.round(f*(0.9+c.policeEffect/(10.0001*c.MAX_POLICE_STATION_EFFECT))));c.fireEffect<c.MAX_FIRE_STATION_EFFECT&&(f=Math.round(f*(0.9+c.fireEffect/(10.0001*c.MAX_FIRE_STATION_EFFECT))));-1E3>d.resValve&&(f=Math.round(0.85*f));-1E3>d.comValve&&(f=Math.round(0.85*f));-1E3>d.indValve&&(f=Math.round(0.85*f));a=1;0===this.cityPop||0===this.cityPopDelta?a=1:this.cityPopDelta==this.cityPop?a=1:0<this.cityPopDelta?a=this.cityPopDelta/this.cityPop+1:0>this.cityPopDelta&&(a=0.95+Math.floor(this.cityPopDelta/
|
||||
(this.cityPop-this.cityPopDelta)));f=Math.round(f*a);f=f-Micro.getFireSeverity(b)-c.cityTax;a=b.unpoweredZoneCount+b.poweredZoneCount;0<a&&(f=Math.round(b.poweredZoneCount/a*f));f=Micro.clamp(f,0,1E3);this.cityScore=Math.round((this.cityScore+f)/2);this.cityScoreDelta=this.cityScore-e},doVotes:function(){var a;for(a=this.cityYes=0;100>a;a++)Random.getRandom(1E3)<this.cityScore&&this.cityYes++},changeEval:function(){this.changed=!0},countProblems:function(){var a;for(a=0;a<Micro.NUM_COMPLAINTS&&this.problemOrder[a]!==
|
||||
Micro.NUMPROBLEMS;a++);return a},getProblemNumber:function(a){return 0>a||a>=Micro.NUM_COMPLAINTS||this.problemOrder[a]===Micro.NUMPROBLEMS?-1:this.problemOrder[a]},getProblemVotes:function(a){return 0>a||a>=Micro.NUM_COMPLAINTS||this.problemOrder[a]==Micro.NUMPROBLEMS?-1:this.problemVotes[this.problemOrder[a]]}};Micro.BudgetProps="autoBudget totalFunds policePercent roadPercent firePercent roadSpend policeSpend fireSpend roadMaintenanceBudget policeMaintenanceBudget fireMaintenanceBudget cityTax roadEffect policeEffect fireEffect".split(" ");
|
||||
Micro.Budget=function(){this.roadEffect=Micro.MAX_ROAD_EFFECT;this.policeEffect=Micro.MAX_POLICESTATION_EFFECT;this.fireEffect=Micro.MAX_FIRESTATION_EFFECT;this.totalFunds=0;this.cityTax=7;this.policeFund=this.fireFund=this.roadFund=this.taxFund=this.cashFlow=0;this.policePercent=this.firePercent=this.roadPercent=1;this.policeSpend=this.fireSpend=this.roadSpend=0;this.autoBudget=!0};
|
||||
Micro.Budget.prototype={constructor:Micro.Budget,save:function(a){for(var b=0,c=Micro.BudgetProps.length;b<c;b++)a[Micro.BudgetProps[b]]=this[Micro.BudgetProps[b]]},load:function(a,b){for(var c=0,d=Micro.BudgetProps.length;c<d;c++)this[Micro.BudgetProps[c]]=a[Micro.BudgetProps[c]];void 0!==b&&b.sendMessage(Messages.AUTOBUDGET_CHANGED,this.autoBudget);void 0!==b&&b.sendMessage(Messages.FUNDS_CHANGED,this.totalFunds)},doBudget:function(a){return this.doBudgetNow(!1,a)},doBudgetMenu:function(a){return this.doBudgetNow(!1,
|
||||
a)},doBudgetNow:function(a,b){this.roadSpend=Math.round(this.roadFund*this.roadPercent);this.fireSpend=Math.round(this.fireFund*this.firePercent);this.policeSpend=Math.round(this.policeFund*this.policePercent);var c=this.roadSpend+this.fireSpend+this.policeSpend;0===c&&(this.policePercent=this.firePercent=this.roadPercent=1,this.roadEffect=this.MAX_ROAD_EFFECT,this.policeEffect=this.MAX_POLICESTATION_EFFECT,this.fireEffect=this.MAX_FIRESTATION_EFFECT);var d=this.totalFunds+this.taxFund,e=d,f=0,g=
|
||||
0,h=0,f=e>=this.roadSpend?this.roadSpend:e,e=e-f,g=e>=this.fireSpend?this.fireSpend:e,e=e-g,h=e>=this.policeSpend?this.policeSpend:e;this.roadPercent=0<this.roadFund?(new Number(f/this.roadFund)).toPrecision(2)-0:1;0<this.fireFund?this.firePercent=(new Number(g/this.fireFund)).toPrecision(2)-0:this.fireFund=1;0<this.policeFund?this.policePercent=(new Number(h/this.policeFund)).toPrecision(2)-0:this.policeFund=1;!this.autoBudget||a?a||this.doBudgetSpend(f,g,h,this.cityTax,b):d>=c?this.doBudgetSpend(f,
|
||||
g,h,this.cityTax,b):(this.autoBudget=!1,b.sendMessage(Messages.AUTOBUDGET_CHANGED,this.autoBudget),b.sendMessage(Messages.BUDGET_NEEDED),b.sendMessage(Messages.NO_MONEY))},doBudgetSpend:function(a,b,c,d,e){this.roadSpend=a;this.fireSpend=b;this.policeSpend=c;this.setTax(d);this.spend(-(this.taxFund-(this.roadSpend+this.fireSpend+this.policeSpend)),e);this.updateFundEffects()},updateFundEffects:function(){this.roadEffect=Micro.MAX_ROAD_EFFECT;this.policeEffect=Micro.MAX_POLICESTATION_EFFECT;this.fireEffect=
|
||||
Micro.MAX_FIRESTATION_EFFECT;0<this.roadFund&&(this.roadEffect=Math.floor(this.roadEffect*this.roadSpend/this.roadFund));0<this.fireFund&&(this.fireEffect=Math.floor(this.fireEffect*this.fireSpend/this.fireFund));0<this.policeFund&&(this.policeEffect=Math.floor(this.policeEffect*this.policeSpend/this.policeFund))},collectTax:function(a,b,c){this.cashFlow=0;this.policeFund=100*b.policeStationPop;this.fireFund=100*b.fireStationPop;this.roadFund=Math.floor((b.roadTotal+2*b.railTotal)*Micro.RLevels[a]);
|
||||
this.taxFund=Math.floor(Math.floor(b.totalPop*b.landValueAverage/120)*this.cityTax*Micro.FLevels[a]);0<b.totalPop?(this.cashFlow=this.taxFund-(this.policeFund+this.fireFund+this.roadFund),this.doBudget(c)):(this.roadEffect=Micro.MAX_ROAD_EFFECT,this.policeEffect=Micro.MAX_POLICESTATION_EFFECT,this.fireEffect=Micro.MAX_FIRESTATION_EFFECT)},setTax:function(a,b){a!==this.cityTax&&(this.cityTax=a,void 0!==b&&b.sendMessage(Messages.TAXRATE_CHANGED,this.cityTax))},setFunds:function(a,b){a!==this.totalFunds&&
|
||||
(this.totalFunds=Math.max(0,a),void 0!==b&&b.sendMessage(Messages.FUNDS_CHANGED,this.totalFunds))},spend:function(a,b){this.setFunds(this.totalFunds-a,b)},shouldDegradeRoad:function(){return this.roadEffect<Math.floor(15*this.MAX_ROAD_EFFECT/16)}};Micro.Valves=function(){this.changed=!1;this.indValve=this.comValve=this.resValve=0;this.indCap=this.comCap=this.resCap=!1};
|
||||
Micro.Valves.prototype={constructor:Micro.Valves,save:function(a){a.resValve=this.resValve;a.comValve=this.comValve;a.indValve=this.indValve},load:function(a,b){this.resValve=a.resValve;this.comValve=a.comValve;this.indValve=a.indValve;this.changed=!0;void 0!==b&&b.sendMessage(Messages.VALVES_UPDATED)},setValves:function(a,b,c){var d,e=b.resPop/8;b.totalPop=Math.round(e+b.comPop+b.indPop);var f=e+e*((0<b.resPop?(b.comHist10[1]+b.indHist10[1])/e:1)-1)+0.02*e,g=b.comHist10[1]+b.indHist10[1];d=0<g?b.resHist10[1]/
|
||||
g:1;d=Micro.clamp(d,0,1.3);g=(e+b.comPop+b.indPop)/3.7*d;d=b.indPop*d*Micro.extMarketParamTable[a];d=Math.max(d,5);g=0<b.comPop?g/b.comPop:g;b=0<b.indPop?d/b.indPop:d;e=Math.min(0<e?f/e:1.3,2);g=Math.min(g,2);b=Math.min(b,2);a=Math.min(c.cityTax+a,20);e=600*(e-1)+Micro.taxTable[a];g=600*(g-1)+Micro.taxTable[a];b=600*(b-1)+Micro.taxTable[a];this.resValve=Micro.clamp(this.resValve+Math.round(e),-Micro.RES_VALVE_RANGE,Micro.RES_VALVE_RANGE);this.comValve=Micro.clamp(this.comValve+Math.round(g),-Micro.COM_VALVE_RANGE,
|
||||
Micro.COM_VALVE_RANGE);this.indValve=Micro.clamp(this.indValve+Math.round(b),-Micro.IND_VALVE_RANGE,Micro.IND_VALVE_RANGE);this.resCap&&0<this.resValve&&(this.resValve=0);this.comCap&&0<this.comValve&&(this.comValve=0);this.indCap&&0<this.indValve&&(this.indValve=0);this.changed=!0}};Micro.Tile=function(a,b){if(!(this instanceof Micro.Tile))return new Micro.Tile;this._value=a;void 0===this._value&&(this._value=Tile.DIRT);1<arguments.length&&(this._value|=b)};
|
||||
Micro.Tile.prototype={constructor:Micro.Tile,getValue:function(){return this._value&Tile.BIT_MASK},setValue:function(a){if(0===arguments.length||"number"!==typeof a||0>a)throw Error("Invalid parameter");var b=0;a<Tile.BIT_START&&(b=this._value&Tile.ALLBITS);this._value=a|b},isBulldozable:function(){return 0<(this._value&Tile.BULLBIT)},isAnimated:function(){return 0<(this._value&Tile.ANIMBIT)},isConductive:function(){return 0<(this._value&Tile.CONDBIT)},isCombustible:function(){return 0<(this._value&
|
||||
Tile.BURNBIT)},isPowered:function(){return 0<(this._value&Tile.POWERBIT)},isZone:function(){return 0<(this._value&Tile.ZONEBIT)},addFlags:function(a){if(!arguments.length||"number"!==typeof a||a<Tile.BIT_START||a>=Tile.BIT_END<<1)throw Error("Invalid parameter");this._value|=a},removeFlags:function(a){if(!arguments.length||"number"!==typeof a||a<Tile.BIT_START||a>=Tile.BIT_END<<1)throw Error("Invalid parameter");this._value&=~a},setFlags:function(a){this._value=this._value&~Tile.ALLBITS|a},getFlags:function(){return this._value&
|
||||
Tile.ALLBITS},getRawValue:function(){return this._value},set:function(a,b){if(2>arguments.length||"number"!==typeof a||"number"!==typeof b||a>=Tile.TILE_COUNT)throw Error("Invalid parameter");this.setValue(a);this.setFlags(b)},toString:function(){var a="Tile# "+this.getValue(),a=a+(this.isCombustible()?" burning":""),a=a+(this.isPowered()?" powered":""),a=a+(this.isAnimated()?" animated":""),a=a+(this.isConductive()?" conductive":""),a=a+(this.isZone()?" zone":"");return a+=this.isBulldozable()?" bulldozeable":
|
||||
""}};var Tile={POWERBIT:32768,CONDBIT:16384,BURNBIT:8192,BULLBIT:4096,ANIMBIT:2048,ZONEBIT:1024};Tile.BLBNBIT=Tile.BULLBIT|Tile.BURNBIT;Tile.BLBNCNBIT=Tile.BULLBIT|Tile.BURNBIT|Tile.CONDBIT;Tile.BNCNBIT=Tile.BURNBIT|Tile.CONDBIT;Tile.ASCBIT=Tile.ANIMBIT|Tile.CONDBIT|Tile.BURNBIT;Tile.ALLBITS=Tile.POWERBIT|Tile.CONDBIT|Tile.BURNBIT|Tile.BULLBIT|Tile.ANIMBIT|Tile.ZONEBIT;Tile.BIT_START=1024;Tile.BIT_END=32768;Tile.BIT_MASK=Tile.BIT_START-1;Tile.DIRT=0;Tile.RIVER=2;Tile.REDGE=3;Tile.CHANNEL=4;
|
||||
Tile.FIRSTRIVEDGE=5;Tile.LASTRIVEDGE=20;Tile.WATER_LOW=Tile.RIVER;Tile.WATER_HIGH=Tile.LASTRIVEDGE;Tile.TREEBASE=21;Tile.WOODS_LOW=Tile.TREEBASE;Tile.LASTTREE=36;Tile.WOODS=37;Tile.UNUSED_TRASH1=38;Tile.UNUSED_TRASH2=39;Tile.WOODS_HIGH=Tile.UNUSED_TRASH2;Tile.WOODS2=40;Tile.WOODS3=41;Tile.WOODS4=42;Tile.WOODS5=43;Tile.RUBBLE=44;Tile.LASTRUBBLE=47;Tile.FLOOD=48;Tile.LASTFLOOD=51;Tile.RADTILE=52;Tile.UNUSED_TRASH3=53;Tile.UNUSED_TRASH4=54;Tile.UNUSED_TRASH5=55;Tile.FIRE=56;Tile.FIREBASE=Tile.FIRE;
|
||||
Tile.LASTFIRE=63;Tile.HBRIDGE=64;Tile.ROADBASE=Tile.HBRIDGE;Tile.VBRIDGE=65;Tile.ROADS=66;Tile.ROADS2=67;Tile.ROADS3=68;Tile.ROADS4=69;Tile.ROADS5=70;Tile.ROADS6=71;Tile.ROADS7=72;Tile.ROADS8=73;Tile.ROADS9=74;Tile.ROADS10=75;Tile.INTERSECTION=76;Tile.HROADPOWER=77;Tile.VROADPOWER=78;Tile.BRWH=79;Tile.LTRFBASE=80;Tile.BRWV=95;Tile.BRWXXX1=111;Tile.BRWXXX2=127;Tile.BRWXXX3=143;Tile.HTRFBASE=144;Tile.BRWXXX4=159;Tile.BRWXXX5=175;Tile.BRWXXX6=191;Tile.LASTROAD=206;Tile.BRWXXX7=207;Tile.HPOWER=208;
|
||||
Tile.VPOWER=209;Tile.LHPOWER=210;Tile.LVPOWER=211;Tile.LVPOWER2=212;Tile.LVPOWER3=213;Tile.LVPOWER4=214;Tile.LVPOWER5=215;Tile.LVPOWER6=216;Tile.LVPOWER7=217;Tile.LVPOWER8=218;Tile.LVPOWER9=219;Tile.LVPOWER10=220;Tile.RAILHPOWERV=221;Tile.RAILVPOWERH=222;Tile.POWERBASE=Tile.HPOWER;Tile.LASTPOWER=Tile.RAILVPOWERH;Tile.UNUSED_TRASH6=223;Tile.HRAIL=224;Tile.VRAIL=225;Tile.LHRAIL=226;Tile.LVRAIL=227;Tile.LVRAIL2=228;Tile.LVRAIL3=229;Tile.LVRAIL4=230;Tile.LVRAIL5=231;Tile.LVRAIL6=232;Tile.LVRAIL7=233;
|
||||
Tile.LVRAIL8=234;Tile.LVRAIL9=235;Tile.LVRAIL10=236;Tile.HRAILROAD=237;Tile.VRAILROAD=238;Tile.RAILBASE=Tile.HRAIL;Tile.LASTRAIL=238;Tile.ROADVPOWERH=239;Tile.RESBASE=240;Tile.FREEZ=244;Tile.HOUSE=249;Tile.LHTHR=Tile.HOUSE;Tile.HHTHR=260;Tile.RZB=265;Tile.HOSPITALBASE=405;Tile.HOSPITAL=409;Tile.CHURCHBASE=414;Tile.CHURCH0BASE=414;Tile.CHURCH=418;Tile.CHURCH0=418;Tile.COMBASE=423;Tile.COMCLR=427;Tile.CZB=436;Tile.COMLAST=609;Tile.INDBASE=612;Tile.INDCLR=616;Tile.LASTIND=620;Tile.IND1=621;
|
||||
Tile.IZB=625;Tile.IND2=641;Tile.IND3=644;Tile.IND4=649;Tile.IND5=650;Tile.IND6=676;Tile.IND7=677;Tile.IND8=686;Tile.IND9=689;Tile.PORTBASE=693;Tile.PORT=698;Tile.LASTPORT=708;Tile.AIRPORTBASE=709;Tile.RADAR=711;Tile.AIRPORT=716;Tile.COALBASE=745;Tile.POWERPLANT=750;Tile.LASTPOWERPLANT=760;Tile.FIRESTBASE=761;Tile.FIRESTATION=765;Tile.POLICESTBASE=770;Tile.POLICESTATION=774;Tile.STADIUMBASE=779;Tile.STADIUM=784;Tile.FULLSTADIUM=800;Tile.NUCLEARBASE=811;Tile.NUCLEAR=816;Tile.LASTZONE=826;
|
||||
Tile.LIGHTNINGBOLT=827;Tile.HBRDG0=828;Tile.HBRDG1=829;Tile.HBRDG2=830;Tile.HBRDG3=831;Tile.HBRDG_END=832;Tile.RADAR0=832;Tile.RADAR1=833;Tile.RADAR2=834;Tile.RADAR3=835;Tile.RADAR4=836;Tile.RADAR5=837;Tile.RADAR6=838;Tile.RADAR7=839;Tile.FOUNTAIN=840;Tile.INDBASE2=844;Tile.TELEBASE=844;Tile.TELELAST=851;Tile.SMOKEBASE=852;Tile.TINYEXP=860;Tile.SOMETINYEXP=864;Tile.LASTTINYEXP=867;Tile.TINYEXPLAST=883;Tile.COALSMOKE1=916;Tile.COALSMOKE2=920;Tile.COALSMOKE3=924;Tile.COALSMOKE4=928;
|
||||
Tile.FOOTBALLGAME1=932;Tile.FOOTBALLGAME2=940;Tile.VBRDG0=948;Tile.VBRDG1=949;Tile.VBRDG2=950;Tile.VBRDG3=951;Tile.NUKESWIRL1=952;Tile.NUKESWIRL2=953;Tile.NUKESWIRL3=954;Tile.NUKESWIRL4=955;Tile.CHURCH1BASE=956;Tile.CHURCH1=960;Tile.CHURCH2BASE=965;Tile.CHURCH2=969;Tile.CHURCH3BASE=974;Tile.CHURCH3=978;Tile.CHURCH4BASE=983;Tile.CHURCH4=987;Tile.CHURCH5BASE=992;Tile.CHURCH5=996;Tile.CHURCH6BASE=1001;Tile.CHURCH6=1005;Tile.CHURCH7BASE=1010;Tile.CHURCH7=1014;Tile.CHURCH7LAST=1018;Tile.TILE_COUNT=1024;
|
||||
Tile.TILE_INVALID=-1;Tile.MIN_SIZE=16;Micro.PositionMaker=function(a,b){function c(a){return"number"===typeof a}if(2>arguments.length||"number"!==typeof a||"number"!==typeof b||0>a||0>b)throw Error("Invalid parameter");var d=[Direction.NORTH,Direction.NORTHEAST,Direction.EAST,Direction.SOUTHEAST,Direction.SOUTH,Direction.SOUTHWEST,Direction.WEST,Direction.NORTHWEST,Direction.INVALID],e=function(f,g,h){if(0===arguments.length)return this.y=this.x=0,this;if(!(1!==arguments.length&&3!==arguments.length||f instanceof e))throw Error("Invalid parameter");
|
||||
if(!(3!==arguments.length||c(g)&&c(h)))throw Error("Invalid parameter");var k;if((k=2===arguments.length)&&!(k=c(f)&&!c(g))&&!(k=f instanceof e&&!c(g))){if(k=f instanceof e)if(k=c(g))k=!(c(g)&&-1!==d.indexOf(g));k=k||!c(f)&&!(f instanceof e)}if(k)throw Error("Invalid parameter");k=!0;c(f)?(this.x=f,this.y=g):(this._assignFrom(f),2===arguments.length?k=this.move(g):3===arguments.length&&(this.x+=g,this.y+=h));if(0>this.x||this.x>=a||0>this.y||this.y>=b||!k)throw Error("Invalid parameter");};e.prototype._assignFrom=
|
||||
function(a){this.x=a.x;this.y=a.y};e.prototype.toString=function(){return"("+this.x+", "+this.y+")"};e.prototype.toInt=function(){return this.y*a+this.x};e.prototype.move=function(c){switch(c){case Direction.INVALID:return!0;case Direction.NORTH:if(0<this.y)return this.y--,!0;break;case Direction.NORTHEAST:if(0<this.y&&this.x<a-1)return this.y--,this.x++,!0;break;case Direction.EAST:if(this.x<a-1)return this.x++,!0;break;case Direction.SOUTHEAST:if(this.y<b-1&&this.x<a-1)return this.x++,this.y++,
|
||||
!0;break;case Direction.SOUTH:if(this.y<b-1)return this.y++,!0;break;case Direction.SOUTHWEST:if(this.y<b-1&&0<this.x)return this.y++,this.x--,!0;break;case Direction.WEST:if(0<this.x)return this.x--,!0;break;case Direction.NORTHWEST:if(0<this.y&&0<this.x)return this.y--,this.x--,!0}return!1};return e};Micro.GameMapProps="cityCentreX cityCentreY pollutionMaxX pollutionMaxY width height".split(" ");
|
||||
Micro.GameMap=function(a,b,c){this.isIsland=!1;this.Direction=new Micro.Direction;this.Position=new Micro.PositionMaker(a,b);this.width=a;this.height=b;this.fsize=this.width*this.height;this.defaultValue=(new Micro.Tile).getValue();this.data=[];this.tilesData=new M_ARRAY_TYPE(this.fsize);this.powerData=new M_ARRAY_TYPE(this.fsize);for(a=this.fsize;a--;)this.data[a]=new Micro.Tile(this.defaultValue),this.tilesData[a]=this.defaultValue;this.cityCentreX=Math.floor(0.5*this.width);this.cityCentreY=Math.floor(0.5*
|
||||
this.height);this.pollutionMaxX=this.cityCentreX;this.pollutionMaxY=this.cityCentreY};
|
||||
Micro.GameMap.prototype={constructor:Micro.GameMap,save:function(a){var b=0,c;for(c=Micro.GameMapProps.length;b<c;)a[Micro.GameMapProps[b]]=this[Micro.GameMapProps[b]],b++;a.map=[];b=0;for(c=this.fsize;b<c;)a.map[b]=this.data[b].getRawValue(),b++;a.tileValue=[];b=0;for(c=this.fsize;b<c;)a.tileValue[b]=this.tilesData[b],b++},load:function(a){var b,c,d=0,e=a.map,f=a.tileValue;for(c=Micro.GameMapProps.length;d<c;)this[Micro.GameMapProps[d]]=a[Micro.GameMapProps[d]],d++;var g=void 0!==e[0].value?!0:!1,
|
||||
d=0;for(c=this.fsize;d<c;)a=d%this.width,b=Math.floor(d/this.width),g?this.setTileValue(a,b,e[d].value):this.setTileValue(a,b,e[d]),d++;d=0;for(c=this.fsize;d<c;)this.tilesData[d]=f[d],d++},_calculateIndex:function(a,b){return a+b*this.width},testBounds:function(a,b){return 0<=a&&0<=b&&a<this.width&&b<this.height},getTile:function(a,b,c){"object"===typeof a&&(b=a.y,a=a.x);var d=this.width,e=this.height;if(0>a||0>b||a>=d||b>=e)return console.warn("getTile called with bad bounds",a,b),new Tile(Tile.TILE_INVALID);
|
||||
a=this.data[a+b*d];if(!c)return a;c.set(a);return a},getTileValue:function(a,b){var c=Error("Invalid parameter");if(1>arguments.length)throw c;"object"===typeof a&&(b=a.y,a=a.x);if(!this.testBounds(a,b))throw c;c=this._calculateIndex(a,b);c in this.data||(this.data[c]=new Micro.Tile(this.defaultValue));return this.data[c].getValue()},getTileFlags:function(a,b){var c=Error("Invalid parameter");if(1>arguments.length)throw c;"object"===typeof a&&(b=a.y,a=a.x);if(!this.testBounds(a,b))throw c;c=this._calculateIndex(a,
|
||||
b);c in this.data||(this.data[c]=new Micro.Tile(this.defaultValue));return this.data[c].getFlags()},getTiles:function(a,b,c,d){var e=Error("Invalid parameter");if(3>arguments.length)throw e;3===arguments.length&&(d=c,c=b,b=a.y,a=a.x);if(!this.testBounds(a,b))throw e;for(var e=[],f=b,g=b+d;f<g;f++){e[f-b]=[];for(var h=a,k=a+c;h<k;h++){var l=this._calculateIndex(h,f);e[f-b].push(this.data[l])}}return e},getTileValues:function(a,b,c,d,e){e=e||[];var f=Error("Invalid parameter");if(3>arguments.length)throw f;
|
||||
3===arguments.length&&(d=c,c=b,b=a.y,a=a.x);for(var f=this.width,g=this.height,h=b,k=b+d;h<k;h++)for(var l=a,m=a+c;l<m;l++)e[(h-b)*c+(l-a)]=0>h||0>l||h>=g||l>=f?Tile.TILE_INVALID:this.data[l+h*f].getRawValue();return e},getTileFromMapOrDefault:function(a,b,c){switch(b){case this.Direction.NORTH:return 0<a.y?this.getTileValue(a.x,a.y-1):c;case this.Direction.EAST:return a.x<this.width-1?this.getTileValue(a.x+1,a.y):c;case this.Direction.SOUTH:return a.y<this.height-1?this.getTileValue(a.x,a.y+1):c;
|
||||
case this.Direction.WEST:return 0<a.x?this.getTileValue(a.x-1,a.y):c;default:return c}},setTile:function(a,b,c,d){3===arguments.length&&(d=c,c=b,b=a.y,a=a.x);var e=this._calculateIndex(a,b);this.data[e].set(c,d);this.tilesData[e]=c},setTo:function(a,b,c){void 0===c&&(c=b,b=a.y,a=a.x);a=this._calculateIndex(a,b);this.data[a]=c;this.tilesData[a]=c.getValue()},setTileValue:function(a,b,c){2===arguments.length&&(c=b,b=a.y,a=a.x);var d=this._calculateIndex(a,b);this.data[d].setValue(c);this.tilesData[d]=
|
||||
c},setTileFlags:function(a,b,c){var d=Error("Invalid parameter");if(2>arguments.length)throw d;2===arguments.length&&(c=b,b=a.y,a=a.x);if(!this.testBounds(a,b))throw d;d=this._calculateIndex(a,b);this.data[d].setFlags(c)},addTileFlags:function(a,b,c){var d=Error("Invalid parameter");if(2>arguments.length)throw d;2===arguments.length&&(c=b,b=a.y,a=a.x);if(!this.testBounds(a,b))throw d;d=this._calculateIndex(a,b);this.data[d].addFlags(c)},removeTileFlags:function(a,b,c){var d=Error("Invalid parameter");
|
||||
if(2>arguments.length)throw d;2===arguments.length&&(c=b,b=a.y,a=a.x);if(!this.testBounds(a,b))throw d;d=this._calculateIndex(a,b);this.data[d].removeFlags(c)},putZone:function(a,b,c,d){var e=Error("Invalid parameter");if(!this.testBounds(a,b)||!this.testBounds(a-1+d,b-1+d))throw e;c=c-1-d;for(var e=a-1,f=b-1,g=f;g<f+d;g++)for(var h=e;h<e+d;h++)h===a&&g===b?this.setTo(h,g,new Micro.Tile(c,Tile.BNCNBIT|Tile.ZONEBIT)):this.setTo(h,g,new Micro.Tile(c,Tile.BNCNBIT)),c+=1}};Micro.TERRAIN_CREATE_ISLAND=0;Micro.TERRAIN_TREE_LEVEL=-1;Micro.TERRAIN_LAKE_LEVEL=-1;Micro.TERRAIN_CURVE_LEVEL=-1;Micro.ISLAND_RADIUS=18;
|
||||
Micro.generateMap=function(){this.SRMatrix=[[0,0,3,3,0,0],[0,3,2,2,3,0],[3,2,2,2,2,3],[3,2,2,2,2,3],[0,3,2,2,3,0],[0,0,3,3,0,0]];this.BRMatrix=[[0,0,0,3,3,3,0,0,0],[0,0,3,2,2,2,3,0,0],[0,3,2,2,2,2,2,3,0],[3,2,2,2,2,2,2,2,3],[3,2,2,2,4,2,2,2,3],[3,2,2,2,2,2,2,2,3],[0,3,2,2,2,2,2,3,0],[0,0,3,2,2,2,3,0,0],[0,0,0,3,3,3,0,0,0]];this.riverEdge=[13,13,17,15,5,2,19,17,9,11,2,13,7,9,5,2]};
|
||||
Micro.generateMap.prototype={constructor:Micro.generateMap,construct:function(a,b){Micro.TERRAIN_TREE_LEVEL=-1;Micro.TERRAIN_LAKE_LEVEL=-1;Micro.TERRAIN_CURVE_LEVEL=-1;Micro.ISLAND_RADIUS=18;this.map=new Micro.GameMap(a||Micro.MAP_WIDTH,b||Micro.MAP_HEIGHT);Micro.TERRAIN_CREATE_ISLAND=Random.getRandom(2)-1;if(0>Micro.TERRAIN_CREATE_ISLAND&&10>Random.getRandom(100))return this.makeIsland(),this.map;1===Micro.TERRAIN_CREATE_ISLAND?this.makeNakedIsland():this.clearMap();if(0!==Micro.TERRAIN_CURVE_LEVEL){var c=
|
||||
40+Random.getRandom(this.map.width-79),d=33+Random.getRandom(this.map.height-66),c=new this.map.Position(c,d);this.doRivers(c)}0!==Micro.TERRAIN_LAKE_LEVEL&&this.makeLakes();this.smoothRiver();0!==Micro.TERRAIN_TREE_LEVEL&&this.doTrees();return this.map},clearMap:function(){var a,b,c=this.map.width,d=this.map.height;for(a=0;a<c;a++)for(b=0;b<d;b++)this.map.setTile(a,b,Tile.DIRT,0)},clearUnnatural:function(){var a,b,c,d=this.map.width,e=this.map.height;for(a=0;a<d;a++)for(b=0;b<e;b++)c=this.map.getTileValue(a,
|
||||
b),c>Tile.WOODS&&this.map.setTile(a,b,Tile.DIRT,0)},makeNakedIsland:function(){this.map.isIsland=!0;var a=Micro.ISLAND_RADIUS,b,c,d=this.map.width,e=this.map.height;for(c=0;c<e;c++)for(b=0;b<d;b++)this.map.setTile(b,c,Tile.RIVER,0);for(c=5;c<e-5;c++)for(b=5;b<d-5;b++)this.map.setTile(b,c,Tile.DIRT,0);for(b=0;b<d-5;b+=2)c=Random.getERandom(a+1),this.plopBRiver(new this.map.Position(b,c)),c=e-10-Random.getERandom(a+1),this.plopBRiver(new this.map.Position(b,c)),this.plopSRiver(new this.map.Position(b,
|
||||
0)),this.plopSRiver(new this.map.Position(b,e-6));for(c=0;c<e-5;c+=2)b=Random.getERandom(a+1),this.plopBRiver(new this.map.Position(b,c)),b=d-10-Random.getERandom(a+1),this.plopBRiver(new this.map.Position(b,c)),this.plopSRiver(new this.map.Position(0,c)),this.plopSRiver(new this.map.Position(d-6,c))},makeIsland:function(){this.makeNakedIsland();this.smoothRiver();this.doTrees()},makeLakes:function(){var a,b,c=this.map.width,d=this.map.height,e;for(e=0>Micro.TERRAIN_LAKE_LEVEL?Random.getRandom(11):
|
||||
0.5*Micro.TERRAIN_LAKE_LEVEL;0<e;)a=Random.getRandom(c-20)+10,b=Random.getRandom(d-19)+10,this.makeSingleLake(new this.map.Position(a,b)),e--},makeSingleLake:function(a){for(var b=Random.getRandom(13)+2;0<b;){var c=new this.map.Position(a,Random.getRandom(13)-6,Random.getRandom(13)-6);Random.getRandom(5)?this.plopSRiver(c):this.plopBRiver(c);b--}},treeSplash:function(a,b){var c;c=0>Micro.TERRAIN_TREE_LEVEL?Random.getRandom(150)+50:Random.getRandom(100+2*Micro.TERRAIN_TREE_LEVEL)+50;for(var d=new this.map.Position(a,
|
||||
b);0<c;){var e=Direction.NORTH+Random.getRandom(7);d.move(e);if(!this.map.testBounds(d.x,d.y))break;this.map.getTileValue(d)===Tile.DIRT&&this.map.setTile(d,Tile.WOODS,Tile.BLBNBIT);c--}},doTrees:function(){var a,b,c,d,e=this.map.width,f=this.map.height;d=0>Micro.TERRAIN_TREE_LEVEL?Random.getRandom(100)+50:Micro.TERRAIN_TREE_LEVEL+3;for(a=0;a<d;a++)b=Random.getRandom(e-1),c=Random.getRandom(f-1),this.treeSplash(b,c);this.smoothTrees();this.smoothTrees()},smoothRiver:function(){var a,b,c,d=this.map.width,
|
||||
e=this.map.height,f,g,h,k=[-1,0,1,0],l=[0,1,0,-1];for(a=0;a<d;a++)for(b=0;b<e;b++)if(this.map.getTileValue(a,b)===Tile.REDGE){var m=0;for(c=0;4>c;c++)if(m<<=1,f=a+k[c],g=b+l[c],h=this.map.testBounds(f,g))f=this.map.getTileValue(f,g),f!==Tile.DIRT&&(f<Tile.WOODS_LOW||f>Tile.WOODS_HIGH)&&m++;c=this.riverEdge[m&15];c!==Tile.RIVER&&Random.getRandom(2)&&c++;this.map.setTile(a,b,c,Tile.BULLBIT)}},isTree:function(a){return a>=Tile.WOODS_LOW&&a<=Tile.WOODS_HIGH},smoothTrees:function(){var a,b,c=this.map.width,
|
||||
d=this.map.height;for(a=0;a<c;a++)for(b=0;b<d;b++)this.isTree(this.map.getTileValue(a,b))&&this.smoothTreesAt(a,b,!1)},smoothTreesAt:function(a,b,c){var d=[-1,0,1,0],e=[0,1,0,-1],f=[0,0,0,34,0,0,36,35,0,32,0,33,30,31,29,37];if(this.isTree(this.map.getTileValue(a,b))){for(var g=0,h=0;4>h;h++){var g=g<<1,k=a+d[h],l=b+e[h];this.map.testBounds(k,l)&&this.isTree(this.map.getTileValue(k,l))&&g++}(d=f[g&15])?(d!==Tile.WOODS&&a+b&1&&(d-=8),this.map.setTile(a,b,d,Tile.BLBNBIT)):c||this.map.setTile(a,b,d,0)}},
|
||||
doRivers:function(a){var b=Direction.NORTH+2*Random.getRandom(3);this.doBRiver(a,b,b);var b=Direction.rotate180(b),c=this.doBRiver(a,b,b),b=Direction.NORTH+2*Random.getRandom(3);this.doSRiver(a,b,c)},doBRiver:function(a,b,c){var d,e;0>Micro.TERRAIN_CURVE_LEVEL?(d=100,e=200):(d=Micro.TERRAIN_CURVE_LEVEL+10,e=Micro.TERRAIN_CURVE_LEVEL+100);for(a=new this.map.Position(a);this.map.testBounds(a.x+4,a.y+4);)this.plopBRiver(a),10>Random.getRandom(d+1)?c=b:(90<Random.getRandom(e+1)&&(c=Direction.rotate45(c)),
|
||||
90<Random.getRandom(e+1)&&(c=Direction.rotate45(c,7))),a.move(c);return c},doSRiver:function(a,b,c){var d,e;0>Micro.TERRAIN_CURVE_LEVEL?(d=100,e=200):(d=Micro.TERRAIN_CURVE_LEVEL+10,e=Micro.TERRAIN_CURVE_LEVEL+100);for(a=new this.map.Position(a);this.map.testBounds(a.x+3,a.y+3);)this.plopSRiver(a),10>Random.getRandom(d+1)?c=b:(90<Random.getRandom(e+1)&&(c=Direction.rotate45(c)),90<Random.getRandom(e+1)&&(c=Direction.rotate45(c,7))),a.move(c);return c},putOnMap:function(a,b,c){if(0!==a&&this.map.testBounds(b,
|
||||
c)){var d=this.map.getTileValue(b,c);d!==Tile.DIRT&&(d===Tile.RIVER&&a!==Tile.CHANNEL||d===Tile.CHANNEL)||this.map.setTile(b,c,a,0)}},plopBRiver:function(a){for(var b=0;9>b;b++)for(var c=0;9>c;c++)this.putOnMap(this.BRMatrix[c][b],a.x+b,a.y+c)},plopSRiver:function(a){for(var b=0;6>b;b++)for(var c=0;6>c;c++)this.putOnMap(this.SRMatrix[c][b],a.x+b,a.y+c)},smoothWater:function(){var a,b,c,d,e,f=this.map.width,g=this.map.height;for(a=0;a<f;a++)for(b=0;b<g;b++)if(c=this.map.getTileValue(a,b),c>=Tile.WATER_LOW&&
|
||||
c<=Tile.WATER_HIGH)for(d=new this.map.Position(a,b),e=Direction.BEGIN;e<Direction.END;e=Direction.increment90(e))if(c=this.map.getTileFromMapOrDefault(d,e,Tile.WATER_LOW),c<Tile.WATER_LOW||c>Tile.WATER_HIGH){this.map.setTile(a,b,Tile.REDGE,0);break}for(a=0;a<f;a++)for(b=0;b<g;b++)if(c=this.map.getTileValue(a,b),c!==Tile.CHANNEL&&c>=Tile.WATER_LOW&&c<=Tile.WATER_HIGH){var h=!0;d=new this.map.Position(a,b);for(e=Direction.BEGIN;e<Direction.END;e=Direction.increment90(e))if(c=this.map.getTileFromMapOrDefault(d,
|
||||
e,Tile.WATER_LOW),c<Tile.WATER_LOW||c>Tile.WATER_HIGH){h=!1;break}h&&this.map.setTile(a,b,Tile.RIVER,0)}for(a=0;a<f;a++)for(b=0;b<g;b++)if(c=this.map.getTileValue(a,b),c>=Tile.WOODS_LOW&&c<=Tile.WOODS_HIGH)for(d=new this.map.Position(a,b),e=Direction.BEGIN;e<Direction.END;e=Direction.increment90(e))if(c=this.map.getTileFromMapOrDefault(d,e,Tile.TILE_INVALID),c===Tile.RIVER||c===Tile.CHANNEL){this.map.setTile(a,b,Tile.REDGE,0);break}}};Micro.unwrapTile=function(a){return function(b){b instanceof Micro.Tile&&(b=b.getValue());return a.call(null,b)}};Micro.canBulldoze=Micro.unwrapTile(function(a){return a>=Tile.FIRSTRIVEDGE&&a<=Tile.LASTRUBBLE||a>=Tile.POWERBASE+2&&a<=Tile.POWERBASE+12||a>=Tile.TINYEXP&&a<=Tile.LASTTINYEXP+2});Micro.isCommercial=Micro.unwrapTile(function(a){return a>=Tile.COMBASE&&a<Tile.INDBASE});Micro.isDriveable=Micro.unwrapTile(function(a){return a>=Tile.ROADBASE&&a<=Tile.LASTRAIL||a===Tile.RAILHPOWERV||a===Tile.RAILVPOWERH});
|
||||
Micro.isFire=Micro.unwrapTile(function(a){return a>=Tile.FIREBASE&&a<Tile.ROADBASE});Micro.isFlood=Micro.unwrapTile(function(a){return a>=Tile.FLOOD&&a<Tile.LASTFLOOD});Micro.isIndustrial=Micro.unwrapTile(function(a){return a>=Tile.INDBASE&&a<Tile.PORTBASE});Micro.isManualExplosion=Micro.unwrapTile(function(a){return a>=Tile.TINYEXP&&a<=Tile.LASTTINYEXP});Micro.isRail=Micro.unwrapTile(function(a){return a>=Tile.RAILBASE&&a<Tile.RESBASE});
|
||||
Micro.isResidential=Micro.unwrapTile(function(a){return a>=Tile.RESBASE&&a<Tile.HOSPITALBASE});Micro.isRoad=Micro.unwrapTile(function(a){return a>=Tile.ROADBASE&&a<Tile.POWERBASE});Micro.normalizeRoad=Micro.unwrapTile(function(a){return a>=Tile.ROADBASE&&a<=Tile.LASTROAD+1?(a&15)+64:a});Micro.isCommercialZone=function(a){return a.isZone()&&Micro.isCommercial(a)};Micro.isIndustrialZone=function(a){return a.isZone()&&Micro.isIndustrial(a)};Micro.isResidentialZone=function(a){return a.isZone()&&Micro.isResidential(a)};
|
||||
Micro.randomFire=function(){return new Micro.Tile(Tile.FIRE+(Random.getRandom16()&3),Tile.ANIMBIT)};Micro.randomRubble=function(){return new Micro.Tile(Tile.RUBBLE+(Random.getRandom16()&3),Tile.BULLBIT)};Micro.HOSPITAL=function(){};Micro.checkBigZone=function(a){switch(a){case Tile.POWERPLANT:case Tile.PORT:case Tile.NUCLEAR:case Tile.STADIUM:a={zoneSize:4,deltaX:0,deltaY:0};break;case Tile.POWERPLANT+1:case Tile.COALSMOKE3:case Tile.COALSMOKE3+1:case Tile.COALSMOKE3+2:case Tile.PORT+1:case Tile.NUCLEAR+1:case Tile.STADIUM+1:a={zoneSize:4,deltaX:-1,deltaY:0};break;case Tile.POWERPLANT+4:case Tile.PORT+4:case Tile.NUCLEAR+4:case Tile.STADIUM+4:a={zoneSize:4,deltaX:0,deltaY:-1};break;case Tile.POWERPLANT+5:case Tile.PORT+5:case Tile.NUCLEAR+
|
||||
5:case Tile.STADIUM+5:a={zoneSize:4,deltaX:-1,deltaY:-1};break;case Tile.AIRPORT:a={zoneSize:6,deltaX:0,deltaY:0};break;case Tile.AIRPORT+1:a={zoneSize:6,deltaX:-1,deltaY:0};break;case Tile.AIRPORT+2:a={zoneSize:6,deltaX:-2,deltaY:0};break;case Tile.AIRPORT+3:a={zoneSize:6,deltaX:-3,deltaY:0};break;case Tile.AIRPORT+6:a={zoneSize:6,deltaX:0,deltaY:-1};break;case Tile.AIRPORT+7:a={zoneSize:6,deltaX:-1,deltaY:-1};break;case Tile.AIRPORT+8:a={zoneSize:6,deltaX:-2,deltaY:-1};break;case Tile.AIRPORT+9:a=
|
||||
{zoneSize:6,deltaX:-3,deltaY:-1};break;case Tile.AIRPORT+12:a={zoneSize:6,deltaX:0,deltaY:-2};break;case Tile.AIRPORT+13:a={zoneSize:6,deltaX:-1,deltaY:-2};break;case Tile.AIRPORT+14:a={zoneSize:6,deltaX:-2,deltaY:-2};break;case Tile.AIRPORT+15:a={zoneSize:6,deltaX:-3,deltaY:-2};break;case Tile.AIRPORT+18:a={zoneSize:6,deltaX:0,deltaY:-3};break;case Tile.AIRPORT+19:a={zoneSize:6,deltaX:-1,deltaY:-3};break;case Tile.AIRPORT+20:a={zoneSize:6,deltaX:-2,deltaY:-3};break;case Tile.AIRPORT+21:a={zoneSize:6,
|
||||
deltaX:-3,deltaY:-3};break;default:a={zoneSize:0,deltaX:0,deltaY:0}}return a};Micro.checkZoneSize=function(a){return a>=Tile.RESBASE-1&&a<=Tile.PORTBASE-1||a>=Tile.LASTPOWERPLANT+1&&a<=Tile.POLICESTATION+4||a>=Tile.CHURCH1BASE&&a<=Tile.CHURCH7LAST?3:a>=Tile.PORTBASE&&a<=Tile.LASTPORT||a>=Tile.COALBASE&&a<=Tile.LASTPOWERPLANT||a>=Tile.STADIUMBASE&&a<=Tile.LASTZONE?4:0};
|
||||
Micro.fireZone=function(a,b,c,d){var e=a.getTileValue(b,c),f=2,g=d.rateOfGrowthMap.worldGet(b,c),g=Micro.clamp(g-20,-200,200);d.rateOfGrowthMap.worldSet(b,c,g);e===Tile.AIRPORT?f=5:e>=Tile.PORTBASE?f=3:e<Tile.PORTBASE&&(f=2);for(d=-1;d<f;d++)for(e=-1;e<f;e++){var g=b+d,h=c+e;a.testBounds(g,h)&&a.getTileValue(g,h>=Tile.ROADBASE)&&a.addTileFlags(g,h,Tile.BULLBIT)}};
|
||||
Micro.getLandPollutionValue=function(a,b,c){var d=a.landValueMap.worldGet(b,c),d=d-a.pollutionDensityMap.worldGet(b,c);return 30>d?0:80>d?1:150>d?2:3};Micro.incRateOfGrowth=function(a,b,c,d){var e=a.rateOfGrowthMap.worldGet(b,c);d=Micro.clamp(e+4*d,-200,200);a.rateOfGrowthMap.worldSet(b,c,d)};
|
||||
Micro.putZone=function(a,b,c,d,e){for(var f=0;3>f;f++)for(var g=0;3>g;g++){var h=a.getTileValue(b+g,c+f);if(h>=Tile.FLOOD&&h<Tile.ROADBASE)return}a.putZone(b,c,d,3);a.addTileFlags(b,c,Tile.BULLBIT);e&&a.addTileFlags(b,c,Tile.POWERBIT)};Micro.pixToWorld=function(a){return a>>4};Micro.worldToPix=function(a){return a<<4};Micro.turnTo=function(a,b){if(a===b)return a;a<b?4>b-a?a++:a--:4>a-b?a--:a++;8<a&&(a=1);1>a&&(a=8);return a};Micro.absoluteValue=function(a){return Math.abs(a)};Micro.getTileValue=function(a,b,c){b=Micro.pixToWorld(b);c=Micro.pixToWorld(c);return 0>b||b>=a.width||0>c||c>=a.height?-1:a.getTileValue(b,c)};Micro.directionTable=[0,3,2,1,3,4,5,7,6,5,7,8,1];
|
||||
Micro.getDir=function(a,b,c,d){a=c-a;b=d-b;d=0>a?0>b?11:8:0>b?2:5;a=Math.abs(a);b=Math.abs(b);2*a<b?d++:2*b<a&&d--;if(0>d||12<d)d=0;return Micro.directionTable[d]};Micro.absoluteDistance=function(a,b,c,d){b=d-b;return Math.abs(c-a)+Math.abs(b)};Micro.checkWet=function(a){return a===Tile.HPOWER||a===Tile.VPOWER||a===Tile.HRAIL||a===Tile.VRAIL||a===Tile.BRWH||a===Tile.BRWV?!0:!1};
|
||||
Micro.destroyMapTile=function(a,b,c,d,e){var f=Micro.pixToWorld(d),g=Micro.pixToWorld(e);if(b.testBounds(f,g)){var h=b.getTile(f,g),k=h.getValue();k<Tile.TREEBASE||(h.isCombustible()?(h.isZone()&&(Micro.fireZone(b,f,g,c),k>Tile.RZB&&a.makeExplosionAt(d,e)),Micro.checkWet(k)?b.setTo(f,g,new Micro.Tile(Tile.RIVER)):b.setTo(f,g,new Micro.Tile(Tile.TINYEXP,Tile.BULLBIT|Tile.ANIMBIT))):k>=Tile.ROADBASE&&k<=Tile.LASTROAD&&b.setTo(f,g,new Micro.Tile(Tile.RIVER)))}};
|
||||
Micro.getDistance=function(a,b,c,d){return Math.abs(a-c)+Math.abs(b-d)};Micro.checkSpriteCollision=function(a,b){return 0!==a.frame&&0!==b.frame&&30>Micro.getDistance(a.x,a.y,b.x,b.y)};Micro.SMOOTH_NEIGHBOURS_THEN_BLOCK=0;Micro.SMOOTH_ALL_THEN_CLAMP=1;Micro.smoothMap=function(a,b,c){for(var d=0,e=a.width;d<e;d++)for(var f=0,g=a.height;f<g;f++){var h=0;0<d&&(h+=a.get(d-1,f));d<a.width-1&&(h+=a.get(d+1,f));0<f&&(h+=a.get(d,f-1));f<a.height-1&&(h+=a.get(d,f+1));c===Micro.SMOOTH_NEIGHBOURS_THEN_BLOCK?(h=a.get(d,f)+Math.floor(h/4),b.set(d,f,Math.floor(h/2))):(h=h+a.get(d,f)>>2,255<h&&(h=255),b.set(d,f,h))}};
|
||||
Micro.decRateOfGrowthMap=function(a){a=a.rateOfGrowthMap;for(var b=0;b<a.width;b++)for(var c=0;c<a.height;c++){var d=a.get(b,c);0!==d&&(0<d?(d--,d=Micro.clamp(d,-200,200),a.set(b,c,d)):0>d&&(d++,d=Micro.clamp(d,-200,200),a.set(b,c,d)))}};Micro.neutraliseRateOfGrowthMap=function(a){a=a.rateOfGrowthMap;for(var b=0,c=a.width;b<c;b++)for(var d=0,e=a.height;d<e;d++){var f=a.get(b,d);0!==f&&(0<f?f--:f++,f=Micro.clamp(f,-200,200),a.set(b,d,f))}};
|
||||
Micro.decTrafficMap=function(a){a=a.trafficDensityMap;for(var b=0;b<a.gameMapWidth;b+=a.blockSize)for(var c=0;c<a.gameMapHeight;c+=a.blockSize){var d=a.worldGet(b,c);0!==d&&(24>=d?a.worldSet(b,c,0):200<d?a.worldSet(b,c,d-34):a.worldSet(b,c,d-24))}};Micro.neutraliseTrafficMap=function(a){a=a.trafficDensityMap;for(var b=0,c=a.width;b<c;b++)for(var d=0,e=a.height;d<e;d++){var f=a.get(b,d);0!==f&&(f=24>=f?0:200<f?f-34:f-24,a.set(b,d,f))}};
|
||||
Micro.getPollutionValue=function(a){if(a<Tile.POWERBASE){if(a>=Tile.HTRFBASE)return 75;if(a>=Tile.LTRFBASE)return 50;if(a<Tile.ROADBASE){if(a>Tile.FIREBASE)return 90;if(a>=Tile.RADTILE)return 255}return 0}return a<=Tile.LASTIND?0:a<Tile.PORTBASE?50:a<=Tile.LASTPOWERPLANT?100:0};Micro.getCityCentreDistance=function(a,b,c){return Math.min((b>a.cityCentreX?b-a.cityCentreX:a.cityCentreX-b)+(c>a.cityCentreY?c-a.cityCentreY:a.cityCentreY-c),64)};
|
||||
Micro.pollutionTerrainLandValueScan=function(a,b,c){var d=c.tempMap1,e=c.tempMap2,f=c.tempMap3;f.clear();var g=c.landValueMap,h=c.terrainDensityMap,k=c.pollutionDensityMap,l=c.crimeRateMap,m,n,p,q=0,x=0;c=0;for(n=g.width;c<n;c++)for(m=0,p=g.height;m<p;m++){for(var r=0,s=!1,u=2*c,t=2*m,w=u;w<=u+1;w++)for(var y=t;y<=t+1;y++){var v=a.getTileValue(w,y);v>Tile.DIRT&&(v<Tile.RUBBLE?(v=f.worldGet(w,y),f.worldSet(w,y,v+15)):(r+=Micro.getPollutionValue(v),v>=Tile.ROADBASE&&(s=!0)))}r=Math.min(r,255);d.set(c,
|
||||
m,r);s?(r=34-Math.floor(Micro.getCityCentreDistance(a,u,t)/2),r<<=2,r+=h.get(c>>1,m>>1),r-=k.get(c,m),190<l.get(c,m)&&(r-=20),r=Micro.clamp(r,1,250),g.set(c,m,r),q+=r,x++):g.set(c,m,0)}b.landValueAverage=0<x?Math.floor(q/x):0;Micro.smoothMap(d,e,Micro.SMOOTH_ALL_THEN_CLAMP);Micro.smoothMap(e,d,Micro.SMOOTH_ALL_THEN_CLAMP);c=l=g=e=0;for(n=a.width;c<n;c+=k.blockSize)for(m=0,p=a.height;m<p;m+=k.blockSize)if(q=d.worldGet(c,m),k.worldSet(c,m,q),0!==q&&(g++,l+=q,q>e||q===e&&Random.getChance(3)))e=q,a.pollutionMaxX=
|
||||
c,a.pollutionMaxY=m;b.pollutionAverage=g?Math.floor(l/g):0;Micro.smoothMap(f,h,Micro.SMOOTH_NEIGHBOURS_THEN_BLOCK)};
|
||||
Micro.crimeScan=function(a,b){var c=b.policeStationMap,d=b.policeStationEffectMap,e=b.crimeRateMap,f=b.landValueMap,g=b.populationDensityMap;Micro.smoothMap(c,d,Micro.SMOOTH_NEIGHBOURS_THEN_BLOCK);Micro.smoothMap(d,c,Micro.SMOOTH_NEIGHBOURS_THEN_BLOCK);Micro.smoothMap(c,d,Micro.SMOOTH_NEIGHBOURS_THEN_BLOCK);for(var h=d=0,k=0,l=e.mapWidth,m=e.blockSize;k<l;k+=m)for(var n=0,p=e.mapHeight;n<p;n+=m){var q=f.worldGet(k,n);0<q?(h+=1,q=128-q,q+=g.worldGet(k,n),q=Math.min(q,300),q-=c.worldGet(k,n),q=Micro.clamp(q,
|
||||
0,250),e.worldSet(k,n,q),d+=q):e.worldSet(k,n,0)}a.crimeAverage=0<h?Math.floor(d/h):0;b.policeStationEffectMap=new Micro.BlockMap(c)};Micro.computeComRateMap=function(a,b){for(var c=b.comRateMap,d=0;d<c.width;d++)for(var e=0;e<c.height;e++){var f=Math.floor(Micro.getCityCentreDistance(a,8*d,8*e)/2),f=4*f,f=64-f;c.set(d,e,f)}};
|
||||
Micro.fillCityCentreDistScoreMap=function(a,b){for(var c=b.cityCentreDistScoreMap,d=0,e=c.width;d<e;d++)for(var f=0,g=c.height;f<g;f++){var h=Math.floor(Micro.getCityCentreDistance(a,8*d,8*f)/2),h=4*h,h=64-h;c.set(d,f,h)}};Micro.getPopulationDensity=function(a,b,c,d){return d<Tile.COMBASE?Residential.getZonePopulation(a,b,c,d):d<Tile.INDBASE?8*Commercial.getZonePopulation(a,b,c,d):d<Tile.PORTBASE?8*Industrial.getZonePopulation(a,b,c,d):0};
|
||||
Micro.populationDensityScan=function(a,b){for(var c=b.tempMap1,d=b.tempMap2,e=0,f=0,g=0,h=0,k=a.width;h<k;h++)for(var l=0,m=a.height;l<m;l++){var n=a.getTile(h,l);n.isZone()?(n=n.getValue(),n=8*Micro.getPopulationDensity(a,h,l,n),n=Math.min(n,254),c.worldSet(h,l,n),e+=h,f+=l,g++):c.worldSet(h,l,0)}Micro.smoothMap(c,d,Micro.SMOOTH_ALL_THEN_CLAMP);Micro.smoothMap(d,c,Micro.SMOOTH_ALL_THEN_CLAMP);Micro.smoothMap(c,d,Micro.SMOOTH_ALL_THEN_CLAMP);b.populationDensityMap.copyFrom(d,function(a){return 2*
|
||||
a});0<g?(a.cityCentreX=Math.floor(e/g),a.cityCentreY=Math.floor(f/g)):(a.cityCentreX=Math.floor(0.5*a.width),a.cityCentreY=Math.floor(0.5*a.height))};Micro.fireAnalysis=function(a){var b=a.fireStationMap,c=a.fireStationEffectMap;Micro.smoothMap(b,c,Micro.SMOOTH_NEIGHBOURS_THEN_BLOCK);Micro.smoothMap(c,b,Micro.SMOOTH_NEIGHBOURS_THEN_BLOCK);Micro.smoothMap(b,c,Micro.SMOOTH_NEIGHBOURS_THEN_BLOCK);a.fireStationEffectMap=new Micro.BlockMap(b)};Micro.Residential=function(a){var b=function(a,b,c,d){d instanceof Micro.Tile&&(d=(new Micro.Tile).getValue());if(d===Tile.FREEZ){for(var e=0,f=b-1;f<=b+1;f++)for(var p=c-1;p<=c+1;p++)if(f!==b||p!==c)d=a.getTileValue(f,p),d>=Tile.LHTHR&&d<=Tile.HHTHR&&(e+=1);return e}return 8*(Math.floor((d-Tile.RZB)/9)%4+1)+16},c=[0,3,6,1,4,7,2,5,8],d=function(a,b,d,e,f,n,p){if(0!==f)if(16<f)Micro.putZone(a,b,d,9*(4*n+Math.floor((f-24)/8))+Tile.RZB,p),Micro.incRateOfGrowth(e,b,d,-8);else if(16===f){a.setTo(b,d,new Micro.Tile(Tile.FREEZ,
|
||||
Tile.BLBNCNBIT|Tile.ZONEBIT));for(p=d-1;p<=d+1;p++)for(f=b-1;f<=b+1;f++)f===b&&p===d||a.setTo(b,d,new Micro.Tile(Tile.LHTHR+n+Random.getRandom(2),Tile.BLBNCNBIT));Micro.incRateOfGrowth(e,b,d,-8)}else for(n=0,Micro.incRateOfGrowth(e,b,d,-1),f=b-1;f<=b+1;f++)for(p=d-1;p<=d+1;p++){e=a.getTileValue(f,p);if(e>=Tile.LHTHR&&e<=Tile.HHTHR){a.setTo(f,p,new Micro.Tile(c[n]+Tile.RESBASE,Tile.BLBNCNBIT));return}n+=1}},e=function(c,e,f,l){var m;a.census.resZonePop+=1;m=c.getTileValue(e,f);var n=b(c,e,f,m);a.census.resPop+=
|
||||
n;var p=c.getTile(e,f).isPowered();l=Micro.ROUTE_FOUND;if(n>Random.getRandom(35)&&(l=a.traffic.makeTraffic(e,f,a.blockMaps,Micro.isCommercial),l===Micro.NO_ROAD_FOUND)){m=Micro.getLandPollutionValue(a.blockMaps,e,f);d(c,e,f,a.blockMaps,n,m,p);return}if(m===Tile.FREEZ||Random.getChance(7))if(m=a.blockMaps,l===Micro.NO_ROAD_FOUND?l=-3E3:(l=m.landValueMap.worldGet(e,f),l-=m.pollutionDensityMap.worldGet(e,f),l=0>l?0:Math.min(32*l,6E3),l-=3E3),l=a.valves.resValve+l,p||(l=-500),-350<l&&l-26380>Random.getRandom16Signed())if(0===
|
||||
n&&Random.getChance(3))0<a.census.needHospital&&(Micro.putZone(c,e,f,Tile.HOSPITAL,p),a.census.needHospital=0);else a:{if(m=Micro.getLandPollutionValue(a.blockMaps,e,f),l=a.blockMaps,!(128<l.pollutionDensityMap.worldGet(e,f))){if(c.getTileValue(e,f)===Tile.FREEZ){if(8>n){for(var p=n=0,q=[0,-1,0,1,-1,1,-1,0,1],x=[0,-1,-1,-1,0,0,1,1,1],r=0;9>r;r++){var s;s=c;var u=e+q[r],t=f+x[r],w=[0,1,0,-1],y=[-1,0,1,0],v=s.getTileValue(u,t);if(v<Tile.RESBASE||v>Tile.RESBASE+8)s=-1;else{for(var A=1,z=0;4>z;z++){var v=
|
||||
u+w[z],B=t+y[z];0>v||v>=s.width||0>B||B>=s.height||(v=s.getTileValue(v,B),v!==Tile.DIRT&&v<=Tile.LASTROAD&&(A+=1))}s=A}s>p?(p=s,n=r):s===p&&Random.getChance(7)&&(n=r)}0<n&&c.testBounds(e+q[n],f+x[n])&&c.setTo(e+q[n],f+x[n],new Micro.Tile(Tile.HOUSE+Random.getRandom(2)+3*m,Tile.BLBNCNBIT));Micro.incRateOfGrowth(l,e,f,1);break a}if(64<l.populationDensityMap.worldGet(e,f)){Micro.putZone(c,e,f,9*(4*m+0)+Tile.RZB,p);Micro.incRateOfGrowth(l,e,f,8);break a}}40>n&&(Micro.putZone(c,e,f,9*(4*m+(Math.floor(n/
|
||||
8)-1))+Tile.RZB,p),Micro.incRateOfGrowth(l,e,f,8))}}else 350>l&&l+26380<Random.getRandom16Signed()&&(m=Micro.getLandPollutionValue(a.blockMaps,e,f),d(c,e,f,a.blockMaps,n,m,p))},f=function(b,c,d,e){a.census.hospitalPop+=1;-1===a.census.needHospital&&0===Random.getRandom(20)&&Micro.putZone(b,c,d,Tile.FREEZ,b.getTile(c,d).isPowered())};return{registerHandlers:function(a,b){a.addAction(Micro.isResidentialZone,e);a.addAction(Micro.HOSPITAL,f);b.addAction(Tile.HOSPITAL,15,3)},getZonePopulation:b}};Micro.Commercial=function(a){var b=function(a,b,c,d){d instanceof Micro.Tile&&(d=(new Micro.Tile).getValue());return d===Tile.COMCLR?0:Math.floor((d-Tile.CZB)/9)%5+1},c=function(a,b,c,d,k,l,m){1<k?(Micro.putZone(a,b,c,9*(5*l+(k-2))+Tile.CZB,m),Micro.incRateOfGrowth(d,b,c,-8)):1===k&&(Micro.putZone(a,b,c,Tile.COMCLR,m),Micro.incRateOfGrowth(d,b,c,-8))},d=function(d,f,g,h){var k;a.census.comZonePop+=1;h=d.getTileValue(f,g);h=b(d,f,g,h);a.census.comPop+=h;var l=d.getTile(f,g).isPowered(),m=Micro.ROUTE_FOUND;
|
||||
if(h>Random.getRandom(5)&&(m=a.traffic.makeTraffic(f,g,a.blockMaps,Micro.isIndustrial),m===Micro.NO_ROAD_FOUND)){k=Micro.getLandPollutionValue(a.blockMaps,f,g);c(d,f,g,a.blockMaps,h,k,l);return}if(Random.getChance(7))if(k=m===Micro.NO_ROAD_FOUND?-3E3:a.blockMaps.comRateMap.worldGet(f,g),k=a.valves.comValve+k,l||(k=-500),m&&-350<k&&k-26380>Random.getRandom16Signed()){k=Micro.getLandPollutionValue(a.blockMaps,f,g);var m=a.blockMaps,n=m.landValueMap.worldGet(f,g);!(h>n>>5)&&5>h&&(Micro.putZone(d,f,g,
|
||||
9*(5*k+h)+Tile.CZB,l),Micro.incRateOfGrowth(m,f,g,8))}else 350>k&&k+26380<Random.getRandom16Signed()&&(k=Micro.getLandPollutionValue(a.blockMaps,f,g),c(d,f,g,a.blockMaps,h,k,l))};return{registerHandlers:function(a,b){a.addAction(Micro.isCommercialZone,d)},getZonePopulation:b}};Micro.Industrial=function(a){var b=function(a,b,c,d){d instanceof Micro.Tile&&(d=(new Micro.Tile).getValue());return d===Tile.INDCLR?0:Math.floor((d-Tile.IZB)/9)%4+1},c=function(a,b,c,d,e,f,g){1<e?(Micro.putZone(a,b,c,9*(4*f+(e-2))+Tile.IZB,g),Micro.incRateOfGrowth(d,b,c,-8)):1===e&&(Micro.putZone(a,b,c,Tile.INDCLR,g),Micro.incRateOfGrowth(d,b,c,-8))},d=[!0,!1,!0,!0,!1,!1,!0,!0],e=[-1,0,1,0,0,0,0,1],f=[-1,0,-1,-1,0,0,-1,-1],g=function(g,k,l,m){a.census.indZonePop+=1;var n=g.getTileValue(k,l);m=b(g,
|
||||
k,l,n);a.census.indPop+=m;var p=g.getTile(k,l).isPowered();n<Tile.IZB||(n=n-Tile.IZB>>3,d[n]&&p?g.addTileFlags(k+e[n],l+f[n],Tile.ASCBIT):(g.addTileFlags(k+e[n],l+f[n],Tile.BNCNBIT),g.removeTileFlags(k+e[n],l+f[n],Tile.ANIMBIT)));n=Micro.ROUTE_FOUND;if(m>Random.getRandom(5)&&(n=a.traffic.makeTraffic(k,l,a.blockMaps,Micro.isResidential),n===Micro.NO_ROAD_FOUND)){c(g,k,l,a.blockMaps,m,Random.getRandom16()&1,p);return}if(Random.getChance(7)){var q;q=n===Micro.NO_ROAD_FOUND?-1E3:0;q=a.valves.indValve+
|
||||
q;p||(q=-500);n&&-350<q&&q-26380>Random.getRandom16Signed()?(n=a.blockMaps,q=Random.getRandom16()&1,4>m&&(Micro.putZone(g,k,l,9*(4*q+m)+Tile.IZB,p),Micro.incRateOfGrowth(n,k,l,8))):350>q&&q+26380<Random.getRandom16Signed()&&c(g,k,l,a.blockMaps,m,Random.getRandom16()&1,p)}};return{registerHandlers:function(a,b){a.addAction(Micro.isIndustrialZone,g)},getZonePopulation:b}};Micro.MiscTiles=function(a){var b=[-1,0,1,0],c=[0,-1,0,1],d=function(d,e,f,g){a.census.firePop+=1;if(0===(Random.getRandom16()&3)){for(g=0;4>g;g++)if(Random.getChance(7)&&d.testBounds(e+b[g],f+c[g])){var n=d.getTile(e,f);n.isCombustible()&&(n.isZone()&&(Micro.fireZone(d,e,f,a.blockMaps),n.getValue()>Tile.IZB&&a.spriteManager.makeExplosionAt(e,f)),d.setTo(Micro.randomFire()))}n=10;g=a.blockMaps.fireStationEffectMap.worldGet(e,f);100<g?n=1:20<g?n=2:0<g&&(n=3);0===Random.getRandom(n)&&d.setTo(e,f,Micro.randomRubble())}},
|
||||
e=function(a,b,c,d){Random.getChance(4095)&&a.setTo(b,c,new Micro.Tile(Tile.DIRT))},f=function(b,c,d,e){a.disasterManager.doFlood(c,d,a.blockMaps)},g=function(a,b,c,d){a.getTileValue(b,c);a.setTo(b,c,Micro.randomRubble())};return{registerHandlers:function(a,b){a.addAction(Micro.isFire,d,!0);a.addAction(Tile.RADTILE,e,!0);a.addAction(Micro.isFlood,f,!0);a.addAction(Micro.isManualExplosion,g,!0)}}};Micro.Road=function(a){var b=function(a,b,c,d,e,f,g){for(var h=0;7>h;h++){var k=b+d[h],l=c+e[h];a.testBounds(k,l)&&a.getTileValue(k,l)===(f[h]&Tile.BIT_MASK)&&a.setTileValue(k,l,g[h])}},c=function(a,b,c,d,e,f,g){for(var h=0;7>h;h++){var k=b+d[h],l=c+e[h];if(a.testBounds(k,l)){var m=a.getTileValue(k,l);m!==Tile.CHANNEL&&(m&15)!==(f[h]&15)||a.setTileValue(k,l,g[h])}}},d=[0,1,0,0,0,0,1],e=[-2,-2,-1,0,1,2,2],f=[Tile.VBRDG0|Tile.BULLBIT,Tile.VBRDG1|Tile.BULLBIT,Tile.RIVER,Tile.BRWV|Tile.BULLBIT,Tile.RIVER,
|
||||
Tile.VBRDG2|Tile.BULLBIT,Tile.VBRDG3|Tile.BULLBIT],g=[Tile.VBRIDGE|Tile.BULLBIT,Tile.RIVER,Tile.VBRIDGE|Tile.BULLBIT,Tile.VBRIDGE|Tile.BULLBIT,Tile.VBRIDGE|Tile.BULLBIT,Tile.VBRIDGE|Tile.BULLBIT,Tile.RIVER],h=[-2,2,-2,-1,0,1,2],k=[-1,-1,0,0,0,0,0],l=[Tile.HBRDG1|Tile.BULLBIT,Tile.HBRDG3|Tile.BULLBIT,Tile.HBRDG0|Tile.BULLBIT,Tile.RIVER,Tile.BRWH|Tile.BULLBIT,Tile.RIVER,Tile.HBRDG2|Tile.BULLBIT],m=[Tile.RIVER,Tile.RIVER,Tile.HBRIDGE|Tile.BULLBIT,Tile.HBRIDGE|Tile.BULLBIT,Tile.HBRIDGE|Tile.BULLBIT,Tile.HBRIDGE|
|
||||
Tile.BULLBIT,Tile.HBRIDGE|Tile.BULLBIT],n=[Tile.ROADBASE,Tile.LTRFBASE,Tile.HTRFBASE],p=function(q,p,r,s){a.census.roadTotal+=1;s=q.getTile(p,r);var u=s.getValue();if(a.budget.shouldDegradeRoad()&&Random.getChance(511)&&(s=q.getTile(p,r),!s.isConductive()&&a.budget.roadEffect<(Random.getRandom16()&31))){s.getValue();2>(u&15)||15===(u&15)?q.setTo(p,r,Tile.RIVER):q.setTo(p,r,Micro.randomRubble());return}if(!s.isCombustible()){a.census.roadTotal+=4;var t;a:if(u===Tile.BRWV)Random.getChance(3)&&340<a.spriteManager.getBoatDistance(p,
|
||||
r)&&c(q,p,r,d,e,f,g),t=!0;else if(u==Tile.BRWH)Random.getChance(3)&&340<a.spriteManager.getBoatDistance(p,r)&&c(q,p,r,h,k,l,m),t=!0;else{if(300>a.spriteManager.getBoatDistance(p,r)||Random.getChance(7))if(u&1){if(p<q.width-1&&q.getTileValue(p+1,r)===Tile.CHANNEL){b(q,p,r,d,e,g,f);t=!0;break a}}else if(0<r&&q.getTileValue(p,r-1)===Tile.CHANNEL){b(q,p,r,h,k,m,l);t=!0;break a}t=!1}if(t)return}var w=0;u<Tile.LTRFBASE?w=0:u<Tile.HTRFBASE?w=1:(a.census.roadTotal+=1,w=2);t=a.blockMaps.trafficDensityMap.worldGet(p,
|
||||
r)>>6;1<t&&(t-=1);t!==w&&(u=(u-Tile.ROADBASE&15)+n[t],s=s.getFlags()&~Tile.ANIMBIT,0<t&&(s|=Tile.ANIMBIT),q.setTo(p,r,new Micro.Tile(u,s)))};return{registerHandlers:function(a,b){a.addAction(Micro.isRoad,p)}}};Micro.Stadia=function(a){var b=function(b,c,f,g){a.census.stadiumPop+=1;b.getTile(c,f).isPowered()&&0===(a.cityTime+c+f&31)&&(b.putZone(c,f,Tile.FULLSTADIUM,4),b.addTileFlags(c,f,Tile.POWERBIT),b.setTo(c+1,f,new Micro.Tile(Tile.FOOTBALLGAME1,Tile.ANIMBIT)),b.setTo(c+1,f+1,new Micro.Tile(Tile.FOOTBALLGAME2,Tile.ANIMBIT)))},c=function(b,c,f,g){a.census.stadiumPop+=1;g=b.getTile(c,f).isPowered();0===(a.cityTime+c+f&7)&&(b.putZone(c,f,Tile.STADIUM,4),g&&b.addTileFlags(c,f,Tile.POWERBIT))};return{registerHandlers:function(a,
|
||||
e){a.addAction(Tile.STADIUM,b);a.addAction(Tile.FULLSTADIUM,c);e.addAction(Tile.STADIUM,15,4)}}};Micro.EmergencyServices=function(a){var b=function(b,c,d){return function(h,k,l,m){a.census[b]+=1;m=a.budget[c];h.getTile(k,l).isPowered()||(m=Math.floor(m/2));h=new h.Position(k,l);a.traffic.findPerimeterRoad(h)||(m=Math.floor(m/2));h=a.blockMaps[d].worldGet(k,l);a.blockMaps[d].worldSet(k,l,h+m)}},c=b("policeStationPop","policeEffect","policeStationMap"),d=b("fireStationPop","fireEffect","fireStationMap");return{registerHandlers:function(a,b){a.addAction(Tile.POLICESTATION,c);a.addAction(Tile.FIRESTATION,
|
||||
d)}}};Micro.Transport=function(a){var b=function(b,c,d,h){a.census.railTotal+=1;a.spriteManager.generateTrain(a.census,c,d);a.budget.shouldDegradeRoad()&&Random.getChance(511)&&(h=b.getTile(c,d),!h.isConductive()&&a.budget.roadEffect<(Random.getRandom16()&31)&&(h.getValue(),b.getTile(c,d)<Tile.RAILBASE+2?b.setTo(c,d,Tile.RIVER):b.setTo(c,d,Micro.randomRubble())))},c=function(b,c,d,h){a.census.airportPop+=1;b.getTile(c,d).isPowered()?(b.getTileValue(c+1,d-1)===Tile.RADAR&&b.setTo(c+1,d-1,new Micro.Tile(Tile.RADAR0,
|
||||
Tile.CONDBIT|Tile.ANIMBIT|Tile.BURNBIT)),0===Random.getRandom(5)?a.spriteManager.generatePlane(c,d):0===Random.getRandom(12)&&a.spriteManager.generateCopter(c,d)):b.setTo(c+1,d-1,new Micro.Tile(Tile.RADAR,Tile.CONDBIT|Tile.BURNBIT))},d=function(b,c,d,h){a.census.seaportPop+=1;b.getTile(c,d).isPowered()&&null===a.spriteManager.getSprite(Micro.SPRITE_SHIP)&&a.spriteManager.generateShip()};return{registerHandlers:function(a,f){a.addAction(Micro.isRail,b);a.addAction(Tile.PORT,d);a.addAction(Tile.AIRPORT,
|
||||
c);f.addAction(Tile.PORT,15,4);f.addAction(Tile.AIRPORT,7,6)}}};Micro.toKey=function(a,b){return[a,b].join()};Micro.fromKey=function(a){a=a.split(",");return{x:a[0]-0,y:a[1]-0}};Micro.WorldEffects=function(a){this._map=a;this._data={}};
|
||||
Micro.WorldEffects.prototype={constructor:Micro.WorldEffects,clear:function(){this._data=[]},getTile:function(a,b){var c=Micro.toKey(a,b),c=this._data[c];void 0===c&&(c=this._map.getTile(a,b));return c},getTileValue:function(a,b){return this.getTile(a,b).getValue()},setTile:function(a,b,c,d){if(void 0!==d&&c instanceof Micro.Tile)throw Error("Flags supplied with already defined tile");void 0!==d||c instanceof Micro.Tile?void 0!==d&&(c=new Micro.Tile(c,d)):c=new Micro.Tile(c);a=Micro.toKey(a,b);this._data[a]=
|
||||
c},apply:function(){for(var a=Object.keys(this._data),b=0,c=a.length;b<c;b++){var d=Micro.fromKey(a[b]);this._map.setTo(d,this._data[a[b]])}}};Micro.BaseTool=function(){this.TOOLRESULT_OK=0;this.TOOLRESULT_FAILED=1;this.TOOLRESULT_NO_MONEY=2;this.TOOLRESULT_NEEDS_BULLDOZE=3;this.autoBulldoze=!0;this.bulldozerCost=1};
|
||||
Micro.BaseTool.prototype={constructor:Micro.BaseTool,init:function(a,b,c,d){Object.defineProperty(this,"toolCost",Micro.makeConstantDescriptor(a));this.result=null;this.isDraggable=d||!1;this._shouldAutoBulldoze=c;this._map=b;this._worldEffects=new Micro.WorldEffects(b);this._applicationCost=0},clear:function(){this._applicationCost=0;this._worldEffects.clear()},addCost:function(a){this._applicationCost+=a},doAutoBulldoze:function(a,b){if(this._shouldAutoBulldoze){var c=this._worldEffects.getTile(a,
|
||||
b);c.isBulldozable()&&(c=Micro.normalizeRoad(c),c>=Tile.TINYEXP&&c<=Tile.LASTTINYEXP||c<Tile.HBRIDGE&&c!==Tile.DIRT)&&(this.addCost(1),this._worldEffects.setTile(a,b,Tile.DIRT))}},apply:function(a){this._worldEffects.apply();a.spend(this._applicationCost);this.clear()},modifyIfEnoughFunding:function(a,b){if(this.result!==this.TOOLRESULT_OK)return this.clear(),!1;if(a.totalFunds<this._applicationCost)return this.result=this.TOOLRESULT_NO_MONEY,this.clear(),!1;this.apply.call(this,a);this.clear();return!0},
|
||||
setAutoBulldoze:function(a){this.autoBulldoze=a}};Micro.RoadTable=[Tile.ROADS,Tile.ROADS2,Tile.ROADS,Tile.ROADS3,Tile.ROADS2,Tile.ROADS2,Tile.ROADS4,Tile.ROADS8,Tile.ROADS,Tile.ROADS6,Tile.ROADS,Tile.ROADS7,Tile.ROADS5,Tile.ROADS10,Tile.ROADS9,Tile.INTERSECTION];Micro.RailTable=[Tile.LHRAIL,Tile.LVRAIL,Tile.LHRAIL,Tile.LVRAIL2,Tile.LVRAIL,Tile.LVRAIL,Tile.LVRAIL3,Tile.LVRAIL7,Tile.LHRAIL,Tile.LVRAIL5,Tile.LHRAIL,Tile.LVRAIL6,Tile.LVRAIL4,Tile.LVRAIL9,Tile.LVRAIL8,Tile.LVRAIL10];
|
||||
Micro.WireTable=[Tile.LHPOWER,Tile.LVPOWER,Tile.LHPOWER,Tile.LVPOWER2,Tile.LVPOWER,Tile.LVPOWER,Tile.LVPOWER3,Tile.LVPOWER7,Tile.LHPOWER,Tile.LVPOWER5,Tile.LHPOWER,Tile.LVPOWER6,Tile.LVPOWER4,Tile.LVPOWER9,Tile.LVPOWER8,Tile.LVPOWER10];Micro.BaseToolConnector=function(){Micro.BaseTool.call(this)};Micro.BaseToolConnector.prototype=Object.create(Micro.BaseTool.prototype);
|
||||
Micro.BaseToolConnector.prototype.fixSingle=function(a,b){var c=0,d=this._worldEffects.getTile(a,b),d=Micro.normalizeRoad(d);d>=Tile.ROADS&&d<=Tile.INTERSECTION?(0<b&&(d=this._worldEffects.getTile(a,b-1),d=Micro.normalizeRoad(d),(d===Tile.HRAILROAD||d>=Tile.ROADBASE&&d<=Tile.VROADPOWER)&&d!==Tile.HROADPOWER&&d!==Tile.VRAILROAD&&d!==Tile.ROADBASE&&(c|=1)),a<this._map.width-1&&(d=this._worldEffects.getTile(a+1,b),d=Micro.normalizeRoad(d),(d===Tile.VRAILROAD||d>=Tile.ROADBASE&&d<=Tile.VROADPOWER)&&d!==
|
||||
Tile.VROADPOWER&&d!==Tile.HRAILROAD&&d!==Tile.VBRIDGE&&(c|=2)),b<this._map.height-1&&(d=this._worldEffects.getTile(a,b+1),d=Micro.normalizeRoad(d),(d===Tile.HRAILROAD||d>=Tile.ROADBASE&&d<=Tile.VROADPOWER)&&d!==Tile.HROADPOWER&&d!==Tile.VRAILROAD&&d!==Tile.ROADBASE&&(c|=4)),0<a&&(d=this._worldEffects.getTile(a-1,b),d=Micro.normalizeRoad(d),(d===Tile.VRAILROAD||d>=Tile.ROADBASE&&d<=Tile.VROADPOWER)&&d!==Tile.VROADPOWER&&d!==Tile.HRAILROAD&&d!==Tile.VBRIDGE&&(c|=8)),this._worldEffects.setTile(a,b,Micro.RoadTable[c]|
|
||||
Tile.BULLBIT|Tile.BURNBIT)):d>=Tile.LHRAIL&&d<=Tile.LVRAIL10?(0<b&&(d=this._worldEffects.getTile(a,b-1),d=Micro.normalizeRoad(d),d>=Tile.RAILHPOWERV&&d<=Tile.VRAILROAD&&d!==Tile.RAILHPOWERV&&d!==Tile.HRAILROAD&&d!==Tile.HRAIL&&(c|=1)),a<this._map.width-1&&(d=this._worldEffects.getTile(a+1,b),d=Micro.normalizeRoad(d),d>=Tile.RAILHPOWERV&&d<=Tile.VRAILROAD&&d!==Tile.RAILVPOWERH&&d!==Tile.VRAILROAD&&d!==Tile.VRAIL&&(c|=2)),b<this._map.height-1&&(d=this._worldEffects.getTile(a,b+1),d=Micro.normalizeRoad(d),
|
||||
d>=Tile.RAILHPOWERV&&d<=Tile.VRAILROAD&&d!==Tile.RAILHPOWERV&&d!==Tile.HRAILROAD&&d!==Tile.HRAIL&&(c|=4)),0<a&&(d=this._worldEffects.getTile(a-1,b),d=Micro.normalizeRoad(d),d>=Tile.RAILHPOWERV&&d<=Tile.VRAILROAD&&d!==Tile.RAILVPOWERH&&d!==Tile.VRAILROAD&&d!==Tile.VRAIL&&(c|=8)),this._worldEffects.setTile(a,b,Micro.RailTable[c]|Tile.BULLBIT|Tile.BURNBIT)):d>=Tile.LHPOWER&&d<=Tile.LVPOWER10&&(0<b&&(d=this._worldEffects.getTile(a,b-1),d.isConductive()&&(d=d.getValue(),d=Micro.normalizeRoad(d),d!==Tile.VPOWER&&
|
||||
d!==Tile.VROADPOWER&&d!==Tile.RAILVPOWERH&&(c|=1))),a<this._map.width-1&&(d=this._worldEffects.getTile(a+1,b),d.isConductive()&&(d=d.getValue(),d=Micro.normalizeRoad(d),d!==Tile.HPOWER&&d!==Tile.HROADPOWER&&d!==Tile.RAILHPOWERV&&(c|=2))),b<this._map.height-1&&(d=this._worldEffects.getTile(a,b+1),d.isConductive()&&(d=d.getValue(),d=Micro.normalizeRoad(d),d!==Tile.VPOWER&&d!==Tile.VROADPOWER&&d!==Tile.RAILVPOWERH&&(c|=4))),0<a&&(d=this._worldEffects.getTile(a-1,b),d.isConductive()&&(d=d.getValue(),
|
||||
d=Micro.normalizeRoad(d),d!==Tile.HPOWER&&d!==Tile.HROADPOWER&&d!==Tile.RAILHPOWERV&&(c|=8))),this._worldEffects.setTile(a,b,Micro.WireTable[c]|Tile.BLBNCNBIT))};Micro.BaseToolConnector.prototype.checkZoneConnections=function(a,b){this.fixSingle(a,b);0<b&&this.fixSingle(a,b-1);a<this._map.width-1&&this.fixSingle(a+1,b);b<this._map.height-1&&this.fixSingle(a,b+1);0<a&&this.fixSingle(a-1,b)};
|
||||
Micro.BaseToolConnector.prototype.checkBorder=function(a,b,c){a-=1;b-=1;var d;for(d=0;d<c;d++)this.fixZone(a+d,b-1);for(d=0;d<c;d++)this.fixZone(a-1,b+d);for(d=0;d<c;d++)this.fixZone(a+d,b+c);for(d=0;d<c;d++)this.fixZone(a+c,b+d)};Micro.ParkTool=function(a){Micro.BaseTool.call(this);this.init(10,a,!0)};Micro.ParkTool.prototype=Object.create(Micro.BaseTool.prototype);Micro.ParkTool.prototype.doTool=function(a,b,c,d){this._worldEffects.getTileValue(a,b)!==Tile.DIRT?this.result=this.TOOLRESULT_NEEDS_BULLDOZE:(d=Random.getRandom(4),c=Tile.BURNBIT|Tile.BULLBIT,4===d?(d=Tile.FOUNTAIN,c|=Tile.ANIMBIT):d+=Tile.WOODS2,this._worldEffects.setTile(a,b,d,c),this.addCost(10),this.result=this.TOOLRESULT_OK)};Micro.BulldozerTool=function(a){Micro.BaseTool.call(this);this.init(10,a,!0)};Micro.BulldozerTool.prototype=Object.create(Micro.BaseTool.prototype);Micro.BulldozerTool.prototype.putRubble=function(a,b,c){for(var d=a;d<a+c;d++)for(var e=b;e<b+c;e++)if(this._map.testBounds(d,e)){var f=this._worldEffects.getTile(d,e);f!=Tile.RADTILE&&f!=Tile.DIRT&&this._worldEffects.setTile(d,e,Tile.TINYEXP+Random.getRandom(2),Tile.ANIMBIT|Tile.BULLBIT)}};
|
||||
Micro.BulldozerTool.prototype.layDoze=function(a,b){var c=this._worldEffects.getTile(a,b);if(!c.isBulldozable())return this.TOOLRESULT_FAILED;c=c.getValue();c=Micro.normalizeRoad(c);switch(c){case Tile.HBRIDGE:case Tile.VBRIDGE:case Tile.BRWV:case Tile.BRWH:case Tile.HBRDG0:case Tile.HBRDG1:case Tile.HBRDG2:case Tile.HBRDG3:case Tile.VBRDG0:case Tile.VBRDG1:case Tile.VBRDG2:case Tile.VBRDG3:case Tile.HPOWER:case Tile.VPOWER:case Tile.HRAIL:case Tile.VRAIL:this._worldEffects.setTile(a,b,Tile.RIVER);
|
||||
break;default:this._worldEffects.setTile(a,b,Tile.DIRT)}this.addCost(1);return this.TOOLRESULT_OK};
|
||||
Micro.BulldozerTool.prototype.doTool=function(a,b,c,d){this._map.testBounds(a,b)||(this.result=this.TOOLRESULT_FAILED);var e=this._worldEffects.getTile(a,b);d=e.getValue();var f=0,g;e.isZone()?(f=Micro.checkZoneSize(d),g=e=0):(g=Micro.checkBigZone(d),f=g.zoneSize,e=g.deltaX,g=g.deltaY);if(0<f){this.addCost(this.bulldozerCost);e=a+e;g=b+g;switch(f){case 3:c.sendMessage(Messages.SOUND_EXPLOSIONHIGH);this.putRubble(e-1,g-1,3);break;case 4:c.sendMessage(Messages.SOUND_EXPLOSIONLOW);this.putRubble(e-1,
|
||||
g-1,4);break;case 6:c.sendMessage(Messages.SOUND_EXPLOSIONHIGH),c.sendMessage(Messages.SOUND_EXPLOSIONLOW),this.putRubble(e-1,g-1,6)}this.result=this.TOOLRESULT_OK}d===Tile.RIVER||d===Tile.REDGE||d===Tile.CHANNEL?(c=this.layDoze(a,b),d!==this._worldEffects.getTileValue(a,b)&&this.addCost(5)):c=this.layDoze(a,b);this.result=c};Micro.BuildingTool=function(a,b,c,d,e){Micro.BaseToolConnector.call(this);this.init(a,c,!1);this.centreTile=b;this.size=d;this.animated=e};Micro.BuildingTool.prototype=Object.create(Micro.BaseToolConnector.prototype);
|
||||
Micro.BuildingTool.prototype.putBuilding=function(a,b){for(var c,d,e,f,g=this.centreTile-this.size-1,h=0;h<this.size;h++){d=b+h;for(var k=0;k<this.size;k++)c=a+k,e=g,f=Tile.BNCNBIT,1===k&&(1===h?f|=Tile.ZONEBIT:2===h&&this.animated&&(f|=Tile.ANIMBIT)),this._worldEffects.setTile(c,d,e,f),g++}};
|
||||
Micro.BuildingTool.prototype.prepareBuildingSite=function(a,b){if(0>a||a+this.size>this._map.width||0>b||b+this.size>this._map.height)return this.TOOLRESULT_FAILED;for(var c,d,e,f=0;f<this.size;f++){d=b+f;for(var g=0;g<this.size;g++)if(c=a+g,e=this._worldEffects.getTileValue(c,d),e!==Tile.DIRT){if(!this.autoBulldoze||!Micro.canBulldoze(e))return this.TOOLRESULT_NEEDS_BULLDOZE;this._worldEffects.setTile(c,d,Tile.DIRT);this.addCost(this.bulldozerCost)}}return this.TOOLRESULT_OK};
|
||||
Micro.BuildingTool.prototype.buildBuilding=function(a,b){a--;b--;var c=this.prepareBuildingSite(a,b);if(c!==this.TOOLRESULT_OK)return c;this.addCost(this.toolCost);this.putBuilding(a,b);this.checkBorder(a,b);return this.TOOLRESULT_OK};Micro.BuildingTool.prototype.doTool=function(a,b,c,d){this.result=this.buildBuilding(a,b)};Micro.RailTool=function(a){Micro.BaseToolConnector.call(this);this.init(20,a,!0,!0)};Micro.RailTool.prototype=Object.create(Micro.BaseToolConnector.prototype);
|
||||
Micro.RailTool.prototype.layRail=function(a,b){this.doAutoBulldoze(a,b);var c=20,d=this._worldEffects.getTileValue(a,b),d=Micro.normalizeRoad(d);switch(d){case Tile.DIRT:this._worldEffects.setTile(a,b,Tile.LHRAIL|Tile.BULLBIT|Tile.BURNBIT);break;case Tile.RIVER:case Tile.REDGE:case Tile.CHANNEL:c=100;if(a<this._map.width-1&&(d=this._worldEffects.getTileValue(a+1,b),d=Micro.normalizeRoad(d),d==Tile.RAILHPOWERV||d==Tile.HRAIL||d>=Tile.LHRAIL&&d<=Tile.HRAILROAD)){this._worldEffects.setTile(a,b,Tile.HRAIL,
|
||||
Tile.BULLBIT);break}if(0<a&&(d=this._worldEffects.getTileValue(a-1,b),d=Micro.normalizeRoad(d),d==Tile.RAILHPOWERV||d==Tile.HRAIL||d>Tile.VRAIL&&d<Tile.VRAILROAD)){this._worldEffects.setTile(a,b,Tile.HRAIL,Tile.BULLBIT);break}if(b<this._map.height-1&&(d=this._worldEffects.getTileValue(a,b+1),d=Micro.normalizeRoad(d),d==Tile.RAILVPOWERH||d==Tile.VRAILROAD||d>Tile.HRAIL&&d<Tile.HRAILROAD)){this._worldEffects.setTile(a,b,Tile.VRAIL,Tile.BULLBIT);break}if(0<b&&(d=this._worldEffects.getTileValue(a,b-1),
|
||||
d=Micro.normalizeRoad(d),d==Tile.RAILVPOWERH||d==Tile.VRAILROAD||d>Tile.HRAIL&&d<Tile.HRAILROAD)){this._worldEffects.setTile(a,b,Tile.VRAIL,Tile.BULLBIT);break}return this.TOOLRESULT_FAILED;case Tile.LHPOWER:this._worldEffects.setTile(a,b,Tile.RAILVPOWERH,Tile.CONDBIT|Tile.BURNBIT|Tile.BULLBIT);break;case Tile.LVPOWER:this._worldEffects.setTile(a,b,Tile.RAILHPOWERV,Tile.CONDBIT|Tile.BURNBIT|Tile.BULLBIT);break;case Tile.ROADS:this._worldEffects.setTile(a,b,Tile.VRAILROAD,Tile.BURNBIT|Tile.BULLBIT);
|
||||
break;case Tile.ROADS2:this._worldEffects.setTile(a,b,Tile.HRAILROAD,Tile.BURNBIT|Tile.BULLBIT);break;default:return this.TOOLRESULT_FAILED}this.addCost(c);this.checkZoneConnections(a,b);return this.TOOLRESULT_OK};Micro.RailTool.prototype.doTool=function(a,b,c,d){this.result=this.layRail(a,b)};Micro.WireTool=function(a){Micro.BaseToolConnector.call(this);this.init(5,a,!0,!0)};Micro.WireTool.prototype=Object.create(Micro.BaseToolConnector.prototype);
|
||||
Micro.WireTool.prototype.layWire=function(a,b){this.doAutoBulldoze(a,b);var c=5,d=this._worldEffects.getTileValue(a,b),d=Micro.normalizeRoad(d);switch(d){case Tile.DIRT:this._worldEffects.setTile(a,b,Tile.LHPOWER,Tile.CONDBIT|Tile.BURNBIT|Tile.BULLBIT);break;case Tile.RIVER:case Tile.REDGE:case Tile.CHANNEL:c=25;if(a<this._map.width-1&&(d=this._worldEffects.getTile(a+1,b),d.isConductive()&&(d=d.getValue(),d=Micro.normalizeRoad(d),d!=Tile.HROADPOWER&&d!=Tile.RAILHPOWERV&&d!=Tile.HPOWER))){this._worldEffects.setTile(a,
|
||||
b,Tile.VPOWER,Tile.CONDBIT|Tile.BULLBIT);break}if(0<a&&(d=this._worldEffects.getTile(a-1,b),d.isConductive()&&(d=d.getValue(),d=Micro.normalizeRoad(d),d!=Tile.HROADPOWER&&d!=Tile.RAILHPOWERV&&d!=Tile.HPOWER))){this._worldEffects.setTile(a,b,Tile.VPOWER,Tile.CONDBIT|Tile.BULLBIT);break}if(b<this._map.height-1&&(d=this._worldEffects.getTile(a,b+1),d.isConductive()&&(d=d.getValue(),d=Micro.normalizeRoad(d),d!=Tile.VROADPOWER&&d!=Tile.RAILVPOWERH&&d!=Tile.VPOWER))){this._worldEffects.setTile(a,b,Tile.HPOWER,
|
||||
Tile.CONDBIT|Tile.BULLBIT);break}if(0<b&&(d=this._worldEffects.getTile(a,b-1),d.isConductive()&&(d=d.getValue(),d=Micro.normalizeRoad(d),d!=Tile.VROADPOWER&&d!=Tile.RAILVPOWERH&&d!=Tile.VPOWER))){this._worldEffects.setTile(a,b,Tile.HPOWER,Tile.CONDBIT|Tile.BULLBIT);break}return this.TOOLRESULT_FAILED;case Tile.ROADS:this._worldEffects.setTile(a,b,Tile.HROADPOWER,Tile.CONDBIT|Tile.BURNBIT|Tile.BULLBIT);break;case Tile.ROADS2:this._worldEffects.setTile(a,b,Tile.VROADPOWER,Tile.CONDBIT|Tile.BURNBIT|
|
||||
Tile.BULLBIT);break;case Tile.LHRAIL:this._worldEffects.setTile(a,b,Tile.RAILHPOWERV,Tile.CONDBIT|Tile.BURNBIT|Tile.BULLBIT);break;case Tile.LVRAIL:this._worldEffects.setTile(a,b,Tile.RAILVPOWERH,Tile.CONDBIT|Tile.BURNBIT|Tile.BULLBIT);break;default:return this.TOOLRESULT_FAILED}this.addCost(c);this.checkZoneConnections(a,b);return this.TOOLRESULT_OK};Micro.WireTool.prototype.doTool=function(a,b,c,d){this.result=this.layWire(a,b)};Micro.RoadTool=function(a){Micro.BaseToolConnector.call(this);this.init(10,a,!0,!0)};Micro.RoadTool.prototype=Object.create(Micro.BaseToolConnector.prototype);
|
||||
Micro.RoadTool.prototype.layRoad=function(a,b){this.doAutoBulldoze(a,b);var c=this._worldEffects.getTileValue(a,b),d=10;switch(c){case Tile.DIRT:this._worldEffects.setTile(a,b,Tile.ROADS,Tile.BULLBIT|Tile.BURNBIT);break;case Tile.RIVER:case Tile.REDGE:case Tile.CHANNEL:d=50;if(a<this._map.width-1&&(c=this._worldEffects.getTileValue(a+1,b),c=Micro.normalizeRoad(c),c===Tile.VRAILROAD||c===Tile.HBRIDGE||c>=Tile.ROADS&&c<=Tile.HROADPOWER)){this._worldEffects.setTile(a,b,Tile.HBRIDGE,Tile.BULLBIT);break}if(0<
|
||||
a&&(c=this._worldEffects.getTileValue(a-1,b),c=Micro.normalizeRoad(c),c===Tile.VRAILROAD||c===Tile.HBRIDGE||c>=Tile.ROADS&&c<=Tile.INTERSECTION)){this._worldEffects.setTile(a,b,Tile.HBRIDGE,Tile.BULLBIT);break}if(b<this._map.height-1&&(c=this._worldEffects.getTileValue(a,b+1),c=Micro.normalizeRoad(c),c===Tile.HRAILROAD||c===Tile.VROADPOWER||c>=Tile.VBRIDGE&&c<=Tile.INTERSECTION)){this._worldEffects.setTile(a,b,Tile.VBRIDGE,Tile.BULLBIT);break}if(0<b&&(c=this._worldEffects.getTileValue(a,b-1),c=Micro.normalizeRoad(c),
|
||||
c===Tile.HRAILROAD||c===Tile.VROADPOWER||c>=Tile.VBRIDGE&&c<=Tile.INTERSECTION)){this._worldEffects.setTile(a,b,Tile.VBRIDGE,Tile.BULLBIT);break}return this.TOOLRESULT_FAILED;case Tile.LHPOWER:this._worldEffects.setTile(a,b,Tile.VROADPOWER|Tile.CONDBIT|Tile.BURNBIT|Tile.BULLBIT);break;case Tile.LVPOWER:this._worldEffects.setTile(a,b,Tile.HROADPOWER|Tile.CONDBIT|Tile.BURNBIT|Tile.BULLBIT);break;case Tile.LHRAIL:this._worldEffects.setTile(a,b,Tile.HRAILROAD|Tile.BURNBIT|Tile.BULLBIT);break;case Tile.LVRAIL:this._worldEffects.setTile(a,
|
||||
b,Tile.VRAILROAD|Tile.BURNBIT|Tile.BULLBIT);break;default:return this.TOOLRESULT_FAILED}this.addCost(d);this.checkZoneConnections(a,b);return this.TOOLRESULT_OK};Micro.RoadTool.prototype.doTool=function(a,b,c,d){this.result=this.layRoad(a,b)};Micro.QueryTool=function(a){Micro.BaseTool.call(this);this.init(0,a,!1,!1);this.txt=""};var debug=!0;Micro.QueryTool.prototype=Object.create(Micro.BaseTool.prototype);Micro.QueryTool.prototype.classifyPopulationDensity=function(a,b,c){a=c.populationDensityMap.worldGet(a,b);a=a>>6&3;this.txt+="Density: "+TXT.densityStrings[a]+"<br>"};
|
||||
Micro.QueryTool.prototype.classifyLandValue=function(a,b,c){a=c.landValueMap.worldGet(a,b);b=0;150<=a?b=3:80<=a?b=2:30<=a&&(b=1);this.txt+="Value: "+TXT.landValueStrings[b]+"<br>"};Micro.QueryTool.prototype.classifyCrime=function(a,b,c){a=c.crimeRateMap.worldGet(a,b);a=a>>6&3;this.txt+="Crime: "+TXT.crimeStrings[a]+"<br>"};Micro.QueryTool.prototype.classifyPollution=function(a,b,c){a=c.pollutionDensityMap.worldGet(a,b);a=a>>6&3;this.txt+="Pollution: "+TXT.pollutionStrings[a]+"<br>"};
|
||||
Micro.QueryTool.prototype.classifyRateOfGrowth=function(a,b,c){a=c.rateOfGrowthMap.worldGet(a,b);a=a>>6&3;this.txt+="Growth: "+TXT.rateStrings[a]};Micro.QueryTool.prototype.classifyDebug=function(a,b,c){};
|
||||
Micro.QueryTool.prototype.classifyZone=function(a,b){var c=[Tile.DIRT,Tile.RIVER,Tile.TREEBASE,Tile.RUBBLE,Tile.FLOOD,Tile.RADTILE,Tile.FIRE,Tile.ROADBASE,Tile.POWERBASE,Tile.RAILBASE,Tile.RESBASE,Tile.COMBASE,Tile.INDBASE,Tile.PORTBASE,Tile.AIRPORTBASE,Tile.COALBASE,Tile.FIRESTBASE,Tile.POLICESTBASE,Tile.STADIUMBASE,Tile.NUCLEARBASE,Tile.HBRDG0,Tile.RADAR0,Tile.FOUNTAIN,Tile.INDBASE2,Tile.FOOTBALLGAME1,Tile.VBRDG0,952],d=this._map.getTileValue(a,b);d>=Tile.COALSMOKE1&&d<Tile.FOOTBALLGAME1&&(d=Tile.COALBASE);
|
||||
var e=0,f,e=0;for(f=c.length-1;e<f&&!(d<c[e+1]);e++);this.txt="Zone: "+TXT.zoneTypes[e]+"<br>"};Micro.QueryTool.prototype.getInfo=function(){return this.txt};
|
||||
Micro.QueryTool.prototype.doTool=function(a,b,c,d){this._map.getTileValue(a,b);debug&&this._map.getTile(a,b);this.classifyZone(a,b);this.classifyPopulationDensity(a,b,d);this.classifyLandValue(a,b,d);this.classifyCrime(a,b,d);this.classifyPollution(a,b,d);this.classifyRateOfGrowth(a,b,d);this.classifyDebug(a,b,d);c.sendMessage(Messages.QUERY_WINDOW_NEEDED);this.result=this.TOOLRESULT_OK};Micro.GameTools=function(a){return{airport:new Micro.BuildingTool(1E4,Tile.AIRPORT,a,6,!1),bulldozer:new Micro.BulldozerTool(a),coal:new Micro.BuildingTool(3E3,Tile.POWERPLANT,a,4,!1),commercial:new Micro.BuildingTool(100,Tile.COMCLR,a,3,!1),fire:new Micro.BuildingTool(500,Tile.FIRESTATION,a,3,!1),industrial:new Micro.BuildingTool(100,Tile.INDCLR,a,3,!1),nuclear:new Micro.BuildingTool(5E3,Tile.NUCLEAR,a,4,!0),park:new Micro.ParkTool(a),police:new Micro.BuildingTool(500,Tile.POLICESTATION,a,3,!1),
|
||||
port:new Micro.BuildingTool(3E3,Tile.PORT,a,4,!1),rail:new Micro.RailTool(a),residential:new Micro.BuildingTool(100,Tile.FREEZ,a,3,!1),road:new Micro.RoadTool(a),query:new Micro.QueryTool(a),stadium:new Micro.BuildingTool(5E3,Tile.STADIUM,a,4,!1),wire:new Micro.WireTool(a)}};Micro.BaseSprite=function(){};
|
||||
Micro.BaseSprite.prototype={constructor:Micro.BaseSprite,init:function(a,b,c,d,e){this.type=a;this.map=b;this.spriteManager=c;this.x=d;this.y=e;this.accel=this.turn=this.flag=this.step=this.newDir=this.dir=this.soundCount=this.count=this.destY=this.destX=this.origY=this.origX=0;this.speed=100},getFileName:function(){return["obj",this.type,"-",this.frame-1].join("")},spriteNotInBounds:function(){var a=Micro.pixToWorld(this.x),b=Micro.pixToWorld(this.y);return 0>a||0>b||a>=this.map.width||b>=this.map.height}};Micro.TrainSprite=function(a,b,c,d){Micro.BaseSprite.call(this);this.init(Micro.SPRITE_TRAIN,a,b,c,d);this.height=this.width=32;this.yOffset=this.xOffset=-16;this.frame=1;this.dir=4;this.tileDeltaX=[0,16,0,-16];this.tileDeltaY=[-16,0,16,0];this.xDelta=[0,4,0,-4,0];this.yDelta=[-4,0,4,0,0];this.TrainPic2=[1,2,1,2,5];this.NORTHSOUTH=1;this.EASTWEST=2;this.NWSE=3;this.NESW=4;this.UNDERWATER=5;this.NORTH=0;this.EAST=1;this.SOUTH=2;this.WEST=3;this.CANTMOVE=4};Micro.TrainSprite.prototype=Object.create(Micro.BaseSprite.prototype);
|
||||
Micro.TrainSprite.prototype.move=function(a,b,c,d){if(this.frame===this.NWSE||this.frame===this.NESW)this.frame=this.TrainPic2[this.dir];this.x+=this.xDelta[this.dir];this.y+=this.yDelta[this.dir];if(0===(a&3)){for(b=a=Random.getRandom16()&3;b<a+4;b++)if(c=b&3,this.dir===this.CANTMOVE||c!==(this.dir+2&3))if(d=Micro.getTileValue(this.map,this.x+this.tileDeltaX[c],this.y+this.tileDeltaY[c]),d>=Tile.RAILBASE&&d<=Tile.LASTRAIL||d===Tile.RAILVPOWERH||d===Tile.RAILHPOWERV){this.frame=this.dir!==c&&this.dir!==
|
||||
this.CANTMOVE?this.dir+c===this.WEST?this.NWSE:this.NESW:this.TrainPic2[c];if(d===Tile.HRAIL||d===Tile.VRAIL)this.frame=this.UNDERWATER;this.dir=c;return}this.dir===this.CANTMOVE?this.frame=0:this.dir=this.CANTMOVE}};Micro.TrainSprite.prototype.explodeSprite=function(a){this.frame=0;this.spriteManager.makeExplosionAt(this.x,this.y);a.sendMessage(Messages.TRAIN_CRASHED)};Micro.AirplaneSprite=function(a,b,c,d){Micro.BaseSprite.call(this);this.init(Micro.SPRITE_AIRPLANE,a,b,c,d);this.height=this.width=48;this.yOffset=this.xOffset=-24;c>Micro.worldToPix(a.width-20)?(this.destX=this.x-200,this.frame=7):(this.destX=this.x+200,this.frame=11);this.destY=this.y;this.xDelta=[0,0,6,8,6,0,-6,-8,-6,8,8,8];this.yDelta=[0,-8,-6,0,6,8,6,0,-6,0,0,0]};Micro.AirplaneSprite.prototype=Object.create(Micro.BaseSprite.prototype);
|
||||
Micro.AirplaneSprite.prototype.move=function(a,b,c,d){d=this.frame;0===a%5&&(8<d?(d--,9>d&&(d=3)):(a=Micro.getDir(this.x,this.y,this.destX,this.destY),d=Micro.turnTo(d,a)),this.frame=d);50>Micro.absoluteDistance(this.x,this.y,this.destX,this.destY)&&(this.destX=Random.getRandom(Micro.worldToPix(this.map.width))+8,this.destY=Random.getRandom(Micro.worldToPix(this.map.height))+8);if(c.enableDisasters){c=!1;a=this.spriteManager.getSpriteList();for(var e=0;e<a.length;e++){var f=a[e];0===f.frame||f.type!==
|
||||
Micro.SPRITE_HELICOPTER&&f.type!==Micro.SPRITE_AIRPLANE||!Micro.checkSpriteCollision(this,f)||(f.explodeSprite(b),c=!0)}c&&this.explodeSprite(b)}this.x+=this.xDelta[d];this.y+=this.yDelta[d];this.spriteNotInBounds()&&(this.frame=0)};Micro.AirplaneSprite.prototype.explodeSprite=function(a){this.frame=0;this.spriteManager.makeExplosionAt(this.x,this.y);a.sendMessage(Messages.PLANE_CRASHED)};Micro.BoatSprite=function(a,b,c,d){Micro.BaseSprite.call(this);this.init(Micro.SPRITE_SHIP,a,b,c,d);this.height=this.width=48;this.yOffset=this.xOffset=-24;c<Micro.worldToPix(4)?this.frame=3:c>=Micro.worldToPix(a.width-4)?this.frame=7:d<Micro.worldToPix(4)?this.frame=5:d>=Micro.worldToPix(a.height-4)?this.frame=1:this.frame=3;this.newDir=this.frame;this.dir=10;this.count=1;this.tileDeltaX=[0,0,1,1,1,0,-1,-1,-1];this.tileDeltaY=[0,-1,-1,0,1,1,1,0,-1];this.xDelta=[0,0,2,2,2,0,-2,-2,-2];this.yDelta=
|
||||
[0,-2,-2,0,2,2,2,0,-2];this.tileWhiteList=[Tile.RIVER,Tile.CHANNEL,Tile.POWERBASE,Tile.POWERBASE+1,Tile.RAILBASE,Tile.RAILBASE+1,Tile.BRWH,Tile.BRWV];this.CANTMOVE=10};Micro.BoatSprite.prototype=Object.create(Micro.BaseSprite.prototype);
|
||||
Micro.BoatSprite.prototype.move=function(a,b,c,d){a=Tile.RIVER;0<this.soundCount&&this.soundCount--;0===this.soundCount&&(1===(Random.getRandom16()&3)&&b.sendMessage(Messages.SOUND_HONKHONK),this.soundCount=200);0<this.count&&this.count--;if(0===this.count){this.count=9;if(this.frame!==this.newDir){this.frame=Micro.turnTo(this.frame,this.newDir);return}c=Random.getRandom16()&7;for(var e=this.frame,f=c;f<c+8;f++)if(e=(f&7)+1,e!==this.dir){var g=Micro.pixToWorld(this.x)+this.tileDeltaX[e],h=Micro.pixToWorld(this.y)+
|
||||
this.tileDeltaY[e];if(this.map.testBounds(g,h)&&(g=this.map.getTileValue(g,h),g===Tile.CHANNEL||g===Tile.BRWH||g===Tile.BRWV||this.oppositeAndUnderwater(g,this.dir,e))){this.newDir=e;this.frame=Micro.turnTo(this.frame,this.newDir);this.dir=e+4;8<this.dir&&(this.dir-=8);break}}f===c+8&&(this.dir=this.CANTMOVE,this.newDir=(Random.getRandom16()&7)+1)}else e=this.frame,e===this.newDir&&(this.x+=this.xDelta[e],this.y+=this.yDelta[e]);if(this.spriteNotInBounds())this.frame=0;else for(c=0;8>c&&a!==this.tileWhiteList[c];c++)7===
|
||||
c&&(this.explodeSprite(b),Micro.destroyMapTile(this.spriteManager,this.map,d,this.x,this.y))};Micro.BoatSprite.prototype.explodeSprite=function(a){this.frame=0;this.spriteManager.makeExplosionAt(this.x,this.y);a.sendMessage(Messages.SHIP_CRASHED)};Micro.BoatSprite.prototype.oppositeAndUnderwater=function(a,b,c){b+=4;8<b&&(b-=8);return c!=b?!1:a==Tile.POWERBASE||a==Tile.POWERBASE+1||a==Tile.RAILBASE||a==Tile.RAILBASE+1?!0:!1};Micro.CopterSprite=function(a,b,c,d){Micro.BaseSprite.call(this);this.init(Micro.SPRITE_HELICOPTER,a,b,c,d);this.height=this.width=32;this.yOffset=this.xOffset=-16;this.frame=5;this.count=1500;this.destX=Random.getRandom(Micro.worldToPix(a.width))+8;this.destY=Random.getRandom(Micro.worldToPix(a.height))+8;this.origX=c;this.origY=d;this.xDelta=[0,0,3,5,3,0,-3,-5,-3];this.yDelta=[0,-5,-3,0,3,5,3,0,-3]};Micro.CopterSprite.prototype=Object.create(Micro.BaseSprite.prototype);
|
||||
Micro.CopterSprite.prototype.move=function(a,b,c,d){0<this.soundCount&&this.soundCount--;0<this.count&&this.count--;if(0===this.count&&(c=this.spriteManager.getSprite(Micro.SPRITE_MONSTER),null!==c?(this.destX=c.x,this.destY=c.y):(c=this.spriteManager.getSprite(Micro.SPRITE_TORNADO),null!==c?(this.destX=c.x,this.destY=c.y):(this.destX=this.origX,this.destY=this.origY)),30>Micro.absoluteDistance(this.x,this.y,this.origX,this.origY))){this.frame=0;return}if(0===this.soundCount){c=Micro.pixToWorld(this.x);
|
||||
var e=Micro.pixToWorld(this.y);0<=c&&c<this.map.width&&0<=e&&e<this.map.height&&170<d.trafficDensityMap.worldGet(c,e)&&0===(Random.getRandom16()&7)&&(b.sendMessage(Messages.HEAVY_TRAFFIC,{x:c,y:e}),b.sendMessage(Messages.SOUND_HEAVY_TRAFFIC),this.soundCount=200)}b=this.frame;0===(a&3)&&(a=Micro.getDir(this.x,this.y,this.destX,this.destY),this.frame=b=Micro.turnTo(b,a));this.x+=this.xDelta[b];this.y+=this.yDelta[b]};
|
||||
Micro.CopterSprite.prototype.explodeSprite=function(a){this.frame=0;this.spriteManager.makeExplosionAt(this.x,this.y);a.sendMessage(Messages.HELICOPTER_CRASHED)};Micro.ExplosionSprite=function(a,b,c,d){Micro.BaseSprite.call(this);this.init(Micro.SPRITE_EXPLOSION,a,b,c,d);this.height=this.width=48;this.yOffset=this.xOffset=-24;this.frame=1};Micro.ExplosionSprite.prototype=Object.create(Micro.BaseSprite.prototype);Micro.ExplosionSprite.prototype.startFire=function(a,b){a=Micro.pixToWorld(a);b=Micro.pixToWorld(b);if(this.map.testBounds(a,b)){var c=this.map.getTile(a,b),d=c.getValue();if(c.isCombustible()||d===Tile.DIRT)c.isZone()||this.map.setTo(a,b,Micro.randomFire())}};
|
||||
Micro.ExplosionSprite.prototype.move=function(a,b,c,d){0===(a&1)&&(1===this.frame&&(a=Micro.pixToWorld(this.x),c=Micro.pixToWorld(this.y),b.sendMessage(Messages.SOUND_EXPLOSIONHIGH),b.sendMessage(Messages.EXPLOSION_REPORTED,{x:a,y:c})),this.frame++);6<this.frame&&(this.frame=0,this.startFire(this.x,this.y),this.startFire(this.x-16,this.y-16),this.startFire(this.x+16,this.y+16),this.startFire(this.x-16,this.y+16),this.startFire(this.x+16,this.y+16))};Micro.MonsterSprite=function(a,b,c,d){Micro.BaseSprite.call(this);this.init(Micro.SPRITE_MONSTER,a,b,c,d);this.height=this.width=48;this.yOffset=this.xOffset=-24;c>Micro.worldToPix(a.width)/2?d>Micro.worldToPix(a.height)/2?this.frame=10:this.frame=7:d>Micro.worldToPix(a.height)/2?this.frame=1:this.frame=4;this.flag=0;this.count=1E3;this.destX=Micro.worldToPix(a.pollutionMaxX);this.destY=Micro.worldToPix(a.pollutionMaxY);this.origX=this.x;this.origY=this.y;this._seenLand=!1;this.xDelta=[2,2,-2,-2,
|
||||
0];this.yDelta=[-2,2,2,-2,0];this.cardinals1=[0,1,2,3];this.cardinals2=[1,2,3,0];this.diagonals1=[2,5,8,11];this.diagonals2=[11,2,5,8]};Micro.MonsterSprite.prototype=Object.create(Micro.BaseSprite.prototype);
|
||||
Micro.MonsterSprite.prototype.move=function(a,b,c,d){0<this.soundCount&&this.soundCount--;a=Math.floor((this.frame-1)/3);var e;if(4>a){c=(this.frame-1)%3;2===c&&(this.step=0);0===c&&(this.step=1);this.step?c++:c--;if(60>Micro.absoluteDistance(this.x,this.y,this.destX,this.destY))if(0===this.flag)this.flag=1,this.destX=this.origX,this.destY=this.origY;else{this.frame=0;return}e=Micro.getDir(this.x,this.y,this.destX,this.destY);e=Math.floor((e-1)/2);e!==a&&Random.getChance(10)&&(c=Random.getRandom16()&
|
||||
1?this.cardinals1[a]:this.cardinals2[a],a=4,this.soundCount||(b.sendMessage(Messages.SOUND_MONSTER),this.soundCount=50+Random.getRandom(100)))}else a=4,e=this.frame,c=e-13&3,Random.getRandom16()&3||(c=Random.getRandom16()&1?this.diagonals1[c]:this.diagonals2[c],a=Math.floor((c-1)/3),c=(c-1)%3);c=3*a+c+1;16<c&&(c=16);this.frame=c;this.x+=this.xDelta[a];this.y+=this.yDelta[a];0<this.count&&this.count--;a=Micro.getTileValue(this.map,this.x,this.y);if(-1===a||a===Tile.RIVER&&500>this.count)this.frame=
|
||||
0;if(a===Tile.DIRT||a>Tile.WATER_HIGH)this._seenLand=!0;a=this.spriteManager.getSpriteList();for(c=0;c<a.length;c++)e=a[c],0===e.frame||e.type!==Micro.SPRITE_AIRPLANE&&e.type!==Micro.SPRITE_HELICOPTER&&e.type!==Micro.SPRITE_SHIP&&e.type!==Micro.SPRITE_TRAIN||!Micro.checkSpriteCollision(this,e)||e.explodeSprite(b);Micro.destroyMapTile(this.spriteManager,this.map,d,this.x,this.y)};Micro.TornadoSprite=function(a,b,c,d){Micro.BaseSprite.call(this);this.init(Micro.SPRITE_TORNADO,a,b,c,d);this.height=this.width=48;this.xOffset=-24;this.yOffset=-40;this.frame=1;this.count=200;this.xDelta=[2,3,2,0,-2,-3];this.yDelta=[-2,0,2,3,2,0]};Micro.TornadoSprite.prototype=Object.create(Micro.BaseSprite.prototype);
|
||||
Micro.TornadoSprite.prototype.move=function(a,b,c,d){a=this.frame;2===a?a=this.flag?3:1:(this.flag=1===a?1:0,a=2);0<this.count&&this.count--;this.frame=a;a=this.spriteManager.getSpriteList();for(c=0;c<a.length;c++){var e=a[c];0===e.frame||e.type!==Micro.SPRITE_AIRPLANE&&e.type!==Micro.SPRITE_HELICOPTER&&e.type!==Micro.SPRITE_SHIP&&e.type!==Micro.SPRITE_TRAIN||!Micro.checkSpriteCollision(this,e)||e.explodeSprite(b)}a=Random.getRandom(5);this.x+=this.xDelta[a];this.y+=this.yDelta[a];this.spriteNotInBounds()&&
|
||||
(this.frame=0);0!==this.count&&0===Random.getRandom(500)&&(this.frame=0);Micro.destroyMapTile(this.spriteManager,this.map,d,this.x,this.y)};Micro.SpriteManager=function(a,b){this.sim=b;this.spriteList=[];this.map=a;this.spriteCycle=0};
|
||||
Micro.SpriteManager.prototype={constructor:Micro.SpriteManager,getSprite:function(a){var b=this.spriteList.filter(function(b){return 0!==b.frame&&b.type===a});return 0===b.length?null:b[0]},getSpriteList:function(){return this.spriteList.slice()},getSpritesInView:function(a,b,c,d){a=Micro.worldToPix(a);b=Micro.worldToPix(b);c=Micro.worldToPix(c);d=Micro.worldToPix(d);return this.spriteList.filter(function(e){return e.x+e.xOffset>=a&&e.y+e.yOffset>=b&&!(e.x+e.xOffset>=c&&e.y+e.yOffset>=d)})},moveObjects:function(){var a=
|
||||
this.sim.messageManager,b=this.sim.disasterManager,c=this.sim.blockMaps;this.spriteCycle+=1;for(var d=this.spriteList.slice(),e=d.length;e--;){var f=d[e];0!==f.frame&&f.move(this.spriteCycle,a,b,c)}this.pruneDeadSprites()},makeSprite:function(a,b,c){this.spriteList.push(new constructors[a](this.map,this,b,c))},makeTornado:function(a){var b=this.getSprite(Micro.SPRITE_TORNADO);if(null!==b)b.count=200;else{var b=Random.getRandom(Micro.worldToPix(this.map.width)-800)+400,c=Random.getRandom(Micro.worldToPix(this.map.height)-
|
||||
200)+100;this.makeSprite(Micro.SPRITE_TORNADO,b,c);a.sendMessage(Messages.TORNADO_SIGHTED,{x:Micro.pixToWorld(b),y:Micro.pixToWorld(c)})}},makeExplosion:function(a,b){this.map.testBounds(a,b)&&this.makeExplosionAt(Micro.worldToPix(a),Micro.worldToPix(b))},makeExplosionAt:function(a,b){this.makeSprite(Micro.SPRITE_EXPLOSION,a,b)},generatePlane:function(a,b){null===this.getSprite(Micro.SPRITE_AIRPLANE)&&this.makeSprite(Micro.SPRITE_AIRPLANE,Micro.worldToPix(a),Micro.worldToPix(b))},generateTrain:function(a,
|
||||
b,c){20<a.totalPop&&null===this.getSprite(Micro.SPRITE_TRAIN)&&0===Random.getRandom(25)&&this.makeSprite(Micro.SPRITE_TRAIN,Micro.worldToPix(b)+8,Micro.worldToPix(c)+8)},generateShip:function(){var a;if(Random.getChance(3))for(a=4;a<this.map.width-2;a++)if(this.map.getTileValue(a,0)===Tile.CHANNEL){this.makeShipHere(a,0);return}if(Random.getChance(3))for(a=1;a<this.map.height-2;a++)if(this.map.getTileValue(0,a)===Tile.CHANNEL){this.makeShipHere(0,a);return}if(Random.getChance(3))for(a=4;a<this.map.width-
|
||||
2;a++)if(this.map.getTileValue(a,this.map.height-1)===Tile.CHANNEL){this.makeShipHere(a,this.map.height-1);return}if(Random.getChance(3))for(a=1;a<this.map.height-2;a++)if(this.map.getTileValue(this.map.width-1,a)===Tile.CHANNEL){this.makeShipHere(this.map.width-1,a);break}},getBoatDistance:function(a,b){for(var c=99999,d=Micro.worldToPix(a)+8,e=Micro.worldToPix(b)+8,f,g=0,h=this.spriteList.length;g<h;g++)f=this.spriteList[g],f.type===Micro.SPRITE_SHIP&&0!==f.frame&&(f=Math.abs(f.x-d)+Math.abs(f.y-
|
||||
e),c=Math.min(c,f));return c},makeShipHere:function(a,b){this.makeSprite(Micro.SPRITE_SHIP,Micro.worldToPix(a),Micro.worldToPix(b))},generateCopter:function(a,b){null===this.getSprite(Micro.SPRITE_HELICOPTER)&&this.makeSprite(Micro.SPRITE_HELICOPTER,Micro.worldToPix(a),Micro.worldToPix(b))},makeMonsterAt:function(a,b,c){this.makeSprite(Micro.SPRITE_MONSTER,Micro.worldToPix(b),Micro.worldToPix(c));a.sendMessage(Messages.MONSTER_SIGHTED,{x:b,y:c})},makeMonster:function(a){var b=this.getSprite(Micro.SPRITE_MONSTER);
|
||||
null!==b&&(b.soundCount=1,b.count=1E3,b.destX=Micro.worldToPix(this.map.pollutionMaxX),b.destY=Micro.worldToPix(this.map.pollutionMaxY));for(var c=b=0;300>c;c++){var d=Random.getRandom(this.map.width-20)+10,e=Random.getRandom(this.map.height-10)+5;if(this.map.getTile(d,e).getValue()===Tile.RIVER){this.makeMonsterAt(a,d,e);b=1;break}}0===b&&this.makeMonsterAt(a,60,50)},pruneDeadSprites:function(a){this.spriteList=this.spriteList.filter(function(a){return 0!==a.frame})}};var constructors={};
|
||||
constructors[Micro.SPRITE_TRAIN]=Micro.TrainSprite;constructors[Micro.SPRITE_SHIP]=Micro.BoatSprite;constructors[Micro.SPRITE_MONSTER]=Micro.MonsterSprite;constructors[Micro.SPRITE_HELICOPTER]=Micro.CopterSprite;constructors[Micro.SPRITE_AIRPLANE]=Micro.AirplaneSprite;constructors[Micro.SPRITE_TORNADO]=Micro.TornadoSprite;constructors[Micro.SPRITE_EXPLOSION]=Micro.ExplosionSprite;Micro.MapScanner=function(a,b){this._map=a;this.mapHeight=this._map.height;this.mapWidth=this._map.width;this._actions=[];this.sim=b};
|
||||
Micro.MapScanner.prototype={constructor:Micro.MapScanner,addAction:function(a,b){this._actions.push({criterion:a,action:b})},mapScan:function(a,b,c){var d,e,f,g;for(c=this.mapHeight;c--;)for(d=a;d<b;d++)if(e=d+c*this.mapWidth,f=this._map.data[e]||new Micro.Tile,g=f.getValue(),!(g<Tile.FLOOD))for(f.isConductive()&&this.sim.powerManager.setTilePower(d,c),f.isZone()&&(this.sim.repairManager.checkTile(d,c,this.sim._cityTime),f.isPowered()?(this.sim.census.poweredZoneCount+=1,this._map.powerData[e]=1):
|
||||
(this.sim.census.unpoweredZoneCount+=1,this._map.powerData[e]=2)),e=this._actions.length;e--;){var h=this._actions[e],k=Micro.isCallable(h.criterion);if(k&&h.criterion.call(null,f)){h.action.call(null,this._map,d,c,null);break}else if(!k&&h.criterion===g){h.action.call(null,this._map,d,c,null);break}}}};Micro.PowerManager=function(a,b){this.sim=b;this._map=a;this._powerStack=[];this.powerGridMap=new Micro.BlockMap(this._map.width,this._map.height,1,0)};
|
||||
Micro.PowerManager.prototype={constructor:Micro.PowerManager,setTilePower:function(a,b){var c=this._map.getTile(a,b),d=c.getValue();d===Tile.NUCLEAR||d===Tile.POWERPLANT||0<this.powerGridMap.worldGet(a,b)?c.addFlags(Tile.POWERBIT):c.removeFlags(Tile.POWERBIT)},clearPowerStack:function(){this._powerStackPointer=0;this._powerStack=[]},testForConductive:function(a,b){var c=new this._map.Position(a);return c.move(b)&&this._map.getTile(c.x,c.y).isConductive()&&0===this.powerGridMap.worldGet(c.x,c.y)?!0:
|
||||
!1},doPowerScan:function(a,b){this.powerGridMap.clear();for(var c=a.coalPowerPop*Micro.COAL_POWER_STRENGTH+a.nuclearPowerPop*Micro.NUCLEAR_POWER_STRENGTH,d=0;0<this._powerStack.length;){var e=this._powerStack.pop(),f=Direction.INVALID,g;do{d++;if(d>c){b.sendMessage(Messages.NOT_ENOUGH_POWER);return}f!==Direction.INVALID&&e.move(f);this.powerGridMap.worldSet(e.x,e.y,1);g=0;for(var h=Direction.BEGIN;h<Direction.END&&2>g;)this.testForConductive(e,h)&&(g++,f=h),h=Direction.increment90(h);1<g&&this._powerStack.push(new this._map.Position(e))}while(g)}},
|
||||
coalPowerFound:function(a,b,c,d){this.sim.census.coalPowerPop+=1;this._powerStack.push(new a.Position(b,c));d=[-1,2,1,2];var e=[-1,-1,0,0];if(!this.sim.is3D)for(var f=0;4>f;f++)a.addTileFlags(b+d[f],c+e[f],Tile.ANIMBIT)},nuclearPowerFound:function(a,b,c,d){d=[3E4,2E4,1E4];if(!this.sim.disasterManager.disastersEnabled||0!==Random.getRandom(d[this.sim.gameLevel]))if(this.sim.census.nuclearPowerPop+=1,this._powerStack.push(new a.Position(b,c)),!this.sim.is3D)for(d=0;4>d;d++)a.addTileFlags(b,c,Tile.ANIMBIT|
|
||||
Tile.CONDBIT|Tile.POWERBIT|Tile.BURNBIT)},registerHandlers:function(a,b){a.addAction(Tile.POWERPLANT,this.coalPowerFound.bind(this));a.addAction(Tile.NUCLEAR,this.nuclearPowerFound.bind(this));b.addAction(Tile.POWERPLANT,7,4);b.addAction(Tile.NUCLEAR,7,4)}};Micro.RepairManager=function(a){this._map=a;this._actions=[]};
|
||||
Micro.RepairManager.prototype={constructor:Micro.RepairManager,addAction:function(a,b,c){this._actions.push({criterion:a,period:b,zoneSize:c})},repairZone:function(a,b,c){for(var d=this._map.getTileValue(a,b)-c-2,e=-1;e<c-1;e++)for(var f=-1;f<c-1;f++){d++;var g=this._map.getTile(a+f,b+e);g.isZone()||g.isAnimated()||(g=g.getValue(),(g<Tile.RUBBLE||g>=Tile.ROADBASE)&&this._map.setTo(a+f,b+e,new Micro.Tile(d,Tile.CONDBIT|Tile.BURNBIT)))}},checkTile:function(a,b,c){for(var d=0,e=this._actions.length;d<
|
||||
e;d++){var f=this._actions[d];if(0===(c&f.period)){var g=this._map.getTile(a,b),h=g.getValue(),k=Micro.isCallable(f.criterion);k&&f.criterion.call(null,g)?this.repairZone(a,b,f.zoneSize):k||f.criterion!==h||this.repairZone(a,b,f.zoneSize)}}}};Micro.vulnerable=function(a){var b=a.getValue();return b<Tile.RESBASE||b>Tile.LASTZONE||a.isZone()?!1:!0};Micro.DisasterManager=function(a,b,c){this._map=a;this._spriteManager=b;this._gameLevel=c;this._floodCount=0;this.DisChance=[4800,2400,60];this.Dx=[0,1,0,-1];this.Dy=[-1,0,1,0];Object.defineProperty(this,"disastersEnabled",Micro.makeConstantDescriptor(!1))};
|
||||
Micro.DisasterManager.prototype={constructor:Micro.DisasterManager,doDisasters:function(a,b){this._floodCount&&this._floodCount--;if(this.disastersEnabled&&Random.getRandom(this.DisChance[this._gameLevel]))switch(Random.getRandom(8)){case 0:case 1:this.setFire(b);break;case 2:case 3:this.makeFlood(b);break;case 5:this._spriteManager.makeTornado(b);break;case 7:case 8:60<a.pollutionAverage&&this._spriteManager.makeMonster(b)}},setDifficulty:function(a){this._gameLevel=a},scenarioDisaster:function(){},
|
||||
makeMeltdown:function(a){for(var b=0;b<this._map.width-1;b++)for(var c=0;c<this._map.height-1;c++)if(this._map.getTileValue(b,c)===Tile.NUCLEAR){this.doMeltdown(a,b,c);return}},makeEarthquake:function(a){var b=Random.getRandom(700)+300;this.doEarthquake(b);a.sendMessage(Messages.EARTHQUAKE,{x:this._map.cityCenterX,y:this._map.cityCenterY});for(a=0;a<b;a++){var c=Random.getRandom(this._map.width-1),d=Random.getRandom(this._map.height-1);Micro.vulnerable(this._map.getTile(c,d))&&(0!==(a&3)?this._map.setTo(c,
|
||||
d,Micro.randomRubble()):this._map.setTo(c,d,Micro.randomFire()))}},setFire:function(a,b,c){b=b||1;c=c||!1;for(var d=0;d<b;d++){var e=Random.getRandom(this._map.width-1),f=Random.getRandom(this._map.height-1),g=this._map.getTile(e,f);if(!g.isZone()&&(g=g.getValue(),g>(c?Tile.LHTHR:Tile.TREEBASE)&&g<Tile.LASTZONE)){this._map.setTo(e,f,Micro.randomFire());a.sendMessage(Messages.FIRE_REPORTED,{x:e,y:f});break}}},makeCrash:function(a){var b=this._spriteManager.getSprite(Micro.SPRITE_AIRPLANE);if(null===
|
||||
b){var b=Random.getRandom(this._map.width-1),c=Random.getRandom(this._map.height-1);this._spriteManager.generatePlane(b,c);b=this._spriteManager.getSprite(Micro.SPRITE_AIRPLANE)}b.explodeSprite(a)},makeFire:function(a){this.setFire(a,40,!1)},makeFlood:function(a){for(var b=0;300>b;b++){var c=Random.getRandom(this._map.width-1),d=Random.getRandom(this._map.height-1),e=this._map.getTileValue(c,d);if(e>Tile.CHANNEL&&e<=Tile.WATER_HIGH)for(e=0;4>e;e++){var f=c+this.Dx[e],g=d+this.Dy[e];if(this._map.testBounds(f,
|
||||
g)){var h=this._map.getTile(f,g);h.getValue();if(h===Tile.DIRT||h.isBulldozable()&&h.isCombustible){this._map.setTo(f,g,new Tile(Tile.FLOOD));this._floodCount=30;a.sendMessage(Messages.FLOODING_REPORTED,{x:f,y:g});return}}}}},doFlood:function(a,b,c){if(0<this._floodCount)for(var d=0;4>d;d++){if(Random.getChance(7)){var e=a+this.Dx[d],f=b+this.Dy[d];if(this._map.testBounds(e,f)){var g=this._map.getTile(e,f),h=g.getValue();if(g.isCombustible()||h===Tile.DIRT||h>=Tile.WOODS5&&h<Tile.FLOOD)g.isZone()&&
|
||||
Micro.fireZone(this.map,e,f,c),this._map.setTo(e,f,new Tile(Tile.FLOOD+Random.getRandom(2)))}}}else Random.getChance(15)&&this._map.setTo(a,b,new Tile(Tile.DIRT))},doMeltdown:function(a,b,c){this._spriteManager.makeExplosion(b-1,c-1);this._spriteManager.makeExplosion(b-1,c+2);this._spriteManager.makeExplosion(b+2,c-1);this._spriteManager.makeExplosion(b+2,c+2);var d,e;for(e=b-1;e<b+3;e++)for(d=c-1;d<c+3;d++)this._map.setTo(e,d,Micro.randomFire());for(var f=0;200>f;f++)if(e=b-20+Random.getRandom(40),
|
||||
d=c-15+Random.getRandom(30),this._map.testBounds(e,d)){var g=this._map.getTile(e,d);g.isZone()||(g.isCombustible()||g.getValue()===Tile.DIRT)&&this._map.setTo(e,d,new Tile(Tile.RADTILE))}a.sendMessage(Messages.NUCLEAR_MELTDOWN,{x:b,y:c})}};Micro.InputStatus=function(a){this.gameTools=new Micro.GameTools(a);this.canvas=document.getElementById(Micro.DEFAULT_ID);this.clickY=this.clickX=-1;this.right=this.left=this.down=this.up=!1;this.mouseY=this.mouseX=-1;this.currentTool=this.toolName=null;this.toolWidth=0;this.toolColour="";this.speedChangeRequested=this.disasterRequested=this.evalRequested=this.budgetRequested=!1;this.requestedSpeed=null;this.bindKeys();var b=this;this.canvas.addEventListener("mouseenter",function(a){b.mouseEnterHandler(a)},
|
||||
!1);this.canvas.addEventListener("mouseleave",function(a){b.mouseLeaveHandler(a)},!1);a=document.getElementsByClassName("toolButton");for(var c=0;c<a.length;c++)a[c].addEventListener("click",function(a){b.toolButtonHandler(a)},!1),a[c].addEventListener("mouseover",function(a){b.toolButtonOver(a)},!1);document.getElementById("evalRequest").addEventListener("click",function(a){b.evalHandler(a)},!1);document.getElementById("budgetRequest").addEventListener("click",function(a){b.budgetHandler(a)},!1);
|
||||
document.getElementById("disasterRequest").addEventListener("click",function(a){b.disasterHandler(a)},!1);document.getElementById("pauseRequest").addEventListener("click",function(a){b.speedChangeHandler(a)},!1)};
|
||||
Micro.InputStatus.prototype={constructor:Micro.InputStatus,bindKeys:function(){var a=this;document.onkeydown=function(b){b=b||window.event;var c=!1;38==b.keyCode?c=a.up=!0:40==b.keyCode?c=a.down=!0:39==b.keyCode?c=a.right=!0:37==b.keyCode&&(c=a.left=!0);c&&b.preventDefault()};document.onkeyup=function(b){b=b||window.event;38==b.keyCode&&(a.up=!1);40==b.keyCode&&(a.down=!1);39==b.keyCode&&(a.right=!1);37==b.keyCode&&(a.left=!1)}},clickHandled:function(){this.clickY=this.clickX=-1;this.currentTool.clear()},
|
||||
getRelativeCoordinates:function(a){var b=this.canvas.getBoundingClientRect(),c;void 0!==a.x&&void 0!==a.y?(c=a.x-b.left,a=a.y-b.top):(c=a.clientX-b.left,a=a.clientY-b.top);return{x:c,y:a}},speedChangeHandled:function(){this.speedChangeRequested=!1;this.requestedSpeed=null},speedChangeHandler:function(a){this.speedChangeRequested=!0;a="Pause"===document.getElementById("pauseRequest").innerHTML?"Play":"Pause";document.getElementById("pauseRequest").innerHTML=a},mouseEnterHandler:function(a){var b=this;
|
||||
this.canvas.addEventListener("mousemove",function(a){b.mouseMoveHandler(a)},!1);this.canvas.addEventListener("click",function(a){b.canvasClickHandler(a)},!1)},mouseLeaveHandler:function(a){var b=this;this.canvas.removeEventListener("mousemove",function(a){b.mouseMoveHandler(a)},!1);this.canvas.removeEventListener("click",function(a){b.canvasClickHandler(a)},!1);this.mouseY=this.mouseX=-1},mouseMoveHandler:function(a){a=this.getRelativeCoordinates(a);this.mouseX=a.x;this.mouseY=a.y},canvasClickHandler:function(a){this.clickX=
|
||||
this.mouseX;this.clickY=this.mouseY;a.preventDefault()},toolButtonOver:function(a){var b=a.target.getAttribute("data-tool");a=a.target.getAttribute("data-price");0==a?(a="",b="info"):a+="$";document.getElementById("buttonsInfos").innerHTML=b+" "+a},toolButtonHandler:function(a){for(var b=document.getElementsByClassName("selected"),c=0;c<b.length;c++)b[c].className=b[c].className.replace("selected","unselected");a.target.className=a.target.className.replace("unselected","selected");this.toolName=a.target.getAttribute("data-tool");
|
||||
this.toolWidth=a.target.getAttribute("data-size");this.currentTool=this.gameTools[this.toolName];this.toolColour=a.target.getAttribute("data-colour");a.preventDefault()},disasterHandler:function(a){this.disasterRequested=!0},evalHandler:function(a){this.evalRequested=!0},budgetHandler:function(a){this.budgetRequested=!0},evalHandled:function(a){this.evalRequested=!1},disasterHandled:function(a){this.disasterRequested=!1},budgetHandled:function(a){this.budgetRequested=!1}};Micro.Traffic=function(a,b){this._map=a;this._stack=[];this._spriteManager=b};
|
||||
Micro.Traffic.prototype={constructor:Micro.Traffic,makeTraffic:function(a,b,c,d){this._stack=[];a=new this._map.Position(a,b);return this.findPerimeterRoad(a)?this.tryDrive(a,d)?(this.addToTrafficDensityMap(c),Micro.ROUTE_FOUND):Micro.NO_ROUTE_FOUND:Micro.NO_ROAD_FOUND},addToTrafficDensityMap:function(a){for(a=a.trafficDensityMap;0<this._stack.length;){var b=this._stack.pop();if(this._map.testBounds(b.x,b.y)){var c=this._map.getTileValue(b.x,b.y);c>=Tile.ROADBASE&&c<Tile.POWERBASE&&(c=a.worldGet(b.x,
|
||||
b.y),c+=50,c=Math.min(c,240),a.worldSet(b.x,b.y,c),240<=c&&0===Random.getRandom(5)&&(c=this._spriteManager.getSprite(Micro.SPRITE_HELICOPTER),null!==c&&(c.destX=Micro.worldToPix(b.x),c.destY=Micro.worldToPix(b.y))))}}},findPerimeterRoad:function(a){for(var b=0;12>b;b++){var c=a.x+Micro.perimX[b],d=a.y+Micro.perimY[b];if(this._map.testBounds(c,d)&&Micro.isDriveable(this._map.getTileValue(c,d)))return a.x=c,a.y=d,!0}return!1},tryDrive:function(a,b){for(var c=Direction.INVALID,d=new this._map.Position(a),
|
||||
e=0;e<Micro.MAX_TRAFFIC_DISTANCE;e++){var f=this.tryGo(d,c);if(f!=Direction.INVALID){if(d.move(f),c=Direction.rotate180(f),e&1&&this._stack.push(new this._map.Position(d)),this.driveDone(d,b))return!0}else if(0<this._stack.length)this._stack.pop(),e+=3;else break}return!1},tryGo:function(a,b){for(var c=[],d=Direction.NORTH,e=0,f=0;4>f;f++)d!=b&&Micro.isDriveable(this._map.getTileFromMapOrDefault(a,d,Tile.DIRT))?(c[f]=d,e++):c[f]=Direction.INVALID,d=Direction.rotate90(d);if(0===e)return Direction.INVALID;
|
||||
if(1===e)for(f=0;4>f;f++)if(c[f]!=Direction.INVALID)return c[f];for(f=Random.getRandom16()&3;c[f]===Direction.INVALID;)f=f+1&3;return c[f]},driveDone:function(a,b){return 0<a.y&&b(this._map.getTileValue(a.x,a.y-1))||a.x<this._map.width-1&&b(this._map.getTileValue(a.x+1,a.y))||a.y<this._map.height-1&&b(this._map.getTileValue(a.x,a.y+1))||0<a.x&&b(this._map.getTileValue(a.x-1,a.y))?!0:!1}};Micro.toKey=function(a,b){return[a,b].join()};Micro.TileHistory=function(){this.clear()};Micro.TileHistory.prototype={constructor:Micro.TileHistory,clear:function(){this.data={}},getTile:function(a,b){var c=Micro.toKey(a,b);return this.data[c]},setTile:function(a,b,c){a=Micro.toKey(a,b);this.data[a]=c}};Micro.AnimationManager=function(a,b,c){this._map=a;this.animationPeriod=b||5;this.blinkPeriod=c||30;this.shouldBlink=!1;this.count=1;this._lastPainted=null;this._data=[];this.initArray();this.registerAnimations()};
|
||||
Micro.AnimationManager.prototype={constructor:Micro.AnimationManager,initArray:function(){for(var a=0;a<Tile.TILE_COUNT;a++)this._data[a]=a},inSequence:function(a,b){for(var c=[a],d=this._data[a];-1===c.indexOf(d);){if(d===b)return!0;c.push(d);d=this._data[d]}return!1},getTiles:function(a,b,c,d,e){e=e||!1;var f=!1;e||(this.count+=1);0===this.count%this.blinkPeriod&&(this.shouldBlink=!this.shouldBlink);0!==this.count%this.animationPeriod||e||(f=!0);e=new Micro.TileHistory;for(var g=[];a<c;a++)for(var h=
|
||||
b;h<d;h++)if(!(0>a||a>=this._map.width||0>h||h>=this._map.height)){var k=this._map.getTile(a,h);if(k.isZone()&&!k.isPowered()&&this.shouldBlink)g.push({x:a,y:h,tileValue:Tile.LIGHTNINGBOLT});else if(k.isAnimated()){var k=k.getValue(),l=Tile.TILE_INVALID,m;this._lastPainted&&(m=this._lastPainted.getTile(a,h));f?l=m&&this.inSequence(k,m)?this._data[m]:this._data[k]:m&&this.inSequence(k,m)&&(l=m);l!==Tile.TILE_INVALID&&(g.push({x:a,y:h,tileValue:l}),e.setTile(a,h,l))}}this._lastPainted=e;return g},registerSingleAnimation:function(a){for(var b=
|
||||
1;b<a.length;b++)this._data[a[b-1]]=a[b]},registerAnimations:function(){this.registerSingleAnimation([56,57,58,59,60,61,62,63,56]);this.registerSingleAnimation([80,128,112,96,80]);this.registerSingleAnimation([81,129,113,97,81]);this.registerSingleAnimation([82,130,114,98,82]);this.registerSingleAnimation([83,131,115,99,83]);this.registerSingleAnimation([84,132,116,100,84]);this.registerSingleAnimation([85,133,117,101,85]);this.registerSingleAnimation([86,134,118,102,86]);this.registerSingleAnimation([87,
|
||||
135,119,103,87]);this.registerSingleAnimation([88,136,120,104,88]);this.registerSingleAnimation([89,137,121,105,89]);this.registerSingleAnimation([90,138,122,106,90]);this.registerSingleAnimation([91,139,123,107,91]);this.registerSingleAnimation([92,140,124,108,92]);this.registerSingleAnimation([93,141,125,109,93]);this.registerSingleAnimation([94,142,126,110,94]);this.registerSingleAnimation([95,143,127,111,95]);this.registerSingleAnimation([144,192,176,160,144]);this.registerSingleAnimation([145,
|
||||
193,177,161,145]);this.registerSingleAnimation([146,194,178,162,146]);this.registerSingleAnimation([147,195,179,163,147]);this.registerSingleAnimation([148,196,180,164,148]);this.registerSingleAnimation([149,197,181,165,149]);this.registerSingleAnimation([150,198,182,166,150]);this.registerSingleAnimation([151,199,183,167,151]);this.registerSingleAnimation([152,200,184,168,152]);this.registerSingleAnimation([153,201,185,169,153]);this.registerSingleAnimation([154,202,186,170,154]);this.registerSingleAnimation([155,
|
||||
203,187,171,155]);this.registerSingleAnimation([156,204,188,172,156]);this.registerSingleAnimation([157,205,189,173,157]);this.registerSingleAnimation([158,206,190,174,158]);this.registerSingleAnimation([159,207,191,175,159]);this.registerSingleAnimation([621,852,853,854,855,856,857,858,859,852]);this.registerSingleAnimation([641,884,885,886,887,884]);this.registerSingleAnimation([644,888,889,890,891,888]);this.registerSingleAnimation([649,892,893,894,895,892]);this.registerSingleAnimation([650,896,
|
||||
897,898,899,896]);this.registerSingleAnimation([676,900,901,902,903,900]);this.registerSingleAnimation([677,904,905,906,907,904]);this.registerSingleAnimation([686,908,909,910,911,908]);this.registerSingleAnimation([689,912,913,914,915,912]);this.registerSingleAnimation([747,916,917,918,919,916]);this.registerSingleAnimation([748,920,921,922,923,920]);this.registerSingleAnimation([751,924,925,926,927,924]);this.registerSingleAnimation([752,928,929,930,931,928]);this.registerSingleAnimation([820,952,
|
||||
953,954,955,952]);this.registerSingleAnimation([832,833,834,835,836,837,838,839,832]);this.registerSingleAnimation([840,841,842,843,840]);this.registerSingleAnimation([844,845,846,847,848,849,850,851,844]);this.registerSingleAnimation([932,933,934,935,936,937,938,939,932]);this.registerSingleAnimation([940,941,942,943,944,945,946,947,940])}};Micro.copyFrom=function(a,b){for(var c=function(a){return b(a)},d=a.data.length;d--;)this.data[d]=a.data[d].map(c)};Micro.makeArrayOf=function(a,b){for(var c=Array(a),d=a;d--;)c[d]=b;return c};
|
||||
Micro.BlockMap=function(a,b,c,d){var e,f,g=function(a){return a},h=Error("Invalid parameters");if(3>arguments.length){if(!(a instanceof Micro.BlockMap)||2===arguments.length&&"function"!==typeof b)throw h;e=a;f=void 0===b?g:b}void 0!==e&&(a=e.gameMapWidth,b=e.gameMapHeight,c=e.blockSize,d=e.defaultValue);Object.defineProperties(this,{gameMapWidth:Micro.makeConstantDescriptor(a),gameMapHeight:Micro.makeConstantDescriptor(b),width:Micro.makeConstantDescriptor(Math.floor((a+1)/c)),height:Micro.makeConstantDescriptor(Math.floor((b+
|
||||
1)/c)),blockSize:Micro.makeConstantDescriptor(c),defaultValue:Micro.makeConstantDescriptor(d)});this.data=[];e?Micro.copyFrom.call(this,e,f):this.clear()};
|
||||
Micro.BlockMap.prototype={constructor:Micro.BlockMap,clear:function(){for(var a=Math.floor(this.gameMapWidth/this.blockSize)+1,b=Math.floor(this.gameMapHeight/this.blockSize)+1;b--;)this.data[b]=Micro.makeArrayOf(a,this.defaultValue)},copyFrom:function(a,b){a.width===this.width&&a.height===this.height&&a.blockSize===this.blockSize||console.warn("Copying from incompatible blockMap!");for(var c=0,d=a.height;c<d;c++)for(var e=0,f=a.width;e<f;e++)this.data[f*c+e]=b(a.data[f*c+e])},get:function(a,b){return this.data[b][a]},
|
||||
set:function(a,b,c){this.data[b][a]=c},toBlock:function(a){return Math.floor(a/this.blockSize)},worldGet:function(a,b){return this.get(this.toBlock(a),this.toBlock(b))},worldSet:function(a,b,c){this.set(this.toBlock(a),this.toBlock(b),c)}};var Residential,Commercial,Industrial,Transport,Road,EmergencyServices,MiscTiles,Stadia;Micro.savePropsVar=["cityTime"];
|
||||
Micro.Simulation=function(a,b,c,d,e){if(b!==Micro.LEVEL_EASY&&b!==Micro.LEVEL_MED&&b!==Micro.LEVEL_HARD)throw Error("Invalid level!");this.map=a;this.gameLevel=b;this.div=this.map.width/8;this.is3D=d||!1;this.speed=c;this.simCycle=this.phaseCycle=this.speedCycle=0;this.doInitialEval=!0;this.cityTime=50;this.cityPopLast=0;this.messageLast=Messages.VILLAGE_REACHED;this.startingYear=1900;this.indValveLast=this.comValveLast=this.resValveLast=0;this._cityMonthLast=this._cityYearLast=-1;this.evaluation=
|
||||
new Micro.Evaluation(this.gameLevel,this);this.valves=new Micro.Valves;this.budget=new Micro.Budget;this.census=new Micro.Census;this.messageManager=new Micro.MessageManager;this.powerManager=new Micro.PowerManager(this.map,this);this.spriteManager=new Micro.SpriteManager(this.map,this);this.mapScanner=new Micro.MapScanner(this.map,this);this.repairManager=new Micro.RepairManager(this.map);this.traffic=new Micro.Traffic(this.map,this.spriteManager);this.disasterManager=new Micro.DisasterManager(this.map,
|
||||
this.spriteManager,this.gameLevel);this.blockMaps={comRateMap:new Micro.BlockMap(this.map.width,this.map.height,8,0),crimeRateMap:new Micro.BlockMap(this.map.width,this.map.height,2,0),fireStationMap:new Micro.BlockMap(this.map.width,this.map.height,8,0),fireStationEffectMap:new Micro.BlockMap(this.map.width,this.map.height,8,0),landValueMap:new Micro.BlockMap(this.map.width,this.map.height,2,0),policeStationMap:new Micro.BlockMap(this.map.width,this.map.height,8,0),policeStationEffectMap:new Micro.BlockMap(this.map.width,
|
||||
this.map.height,8,0),pollutionDensityMap:new Micro.BlockMap(this.map.width,this.map.height,2,0),populationDensityMap:new Micro.BlockMap(this.map.width,this.map.height,2,0),rateOfGrowthMap:new Micro.BlockMap(this.map.width,this.map.height,8,0),terrainDensityMap:new Micro.BlockMap(this.map.width,this.map.height,4,0),trafficDensityMap:new Micro.BlockMap(this.map.width,this.map.height,2,0),tempMap1:new Micro.BlockMap(this.map.width,this.map.height,2,0),tempMap2:new Micro.BlockMap(this.map.width,this.map.height,
|
||||
2,0),tempMap3:new Micro.BlockMap(this.map.width,this.map.height,4,0)};this.clearCensus();e?this.load(e):(this.budget.setFunds(2E4),this.census.totalPop=1);this.init()};
|
||||
Micro.Simulation.prototype={constructor:Micro.Simulation,save:function(a){for(var b=0,c=Micro.savePropsVar.length;b<c;b++)a[Micro.savePropsVar[b]]=this[Micro.savePropsVar[b]];this.map.save(a);this.evaluation.save(a);this.valves.save(a);this.budget.save(a);this.census.save(a)},load:function(a){this.messageManager.clear();for(var b=0,c=Micro.savePropsVar.length;b<c;b++)this[Micro.savePropsVar[b]]=a[Micro.savePropsVar[b]];this.evaluation.load(a);this.valves.load(a,this.messageManager);this.budget.load(a,
|
||||
this.messageManager);this.census.load(a)},setSpeed:function(a){if(a!==Micro.SPEED_PAUSED&&a!==Micro.SPEED_SLOW&&a!==Micro.SPEED_MED&&a!==Micro.SPEED_FAST)throw Error("Invalid speed!");this.speed=a},setDifficulty:function(a){if(a!==Micro.LEVEL_EASY&&a!==Micro.LEVEL_MED&&a!==Micro.LEVEL_HARD)throw Error("Invalid level!");this.gameLevel=a;this.disasterManager.setDifficulty(this.gameLevel)},isPaused:function(){return this.speed===Micro.SPEED_PAUSED},simFrame:function(){this.budget.awaitingValues||0===
|
||||
this.speed||1===this.speed&&0!==this.speedCycle%5||2===this.speed&&0!==this.speedCycle%3||(this.messageManager.clear(),this.simulate())},clearCensus:function(){this.census.clearCensus();this.powerManager.clearPowerStack();this.blockMaps.fireStationMap.clear();this.blockMaps.policeStationMap.clear()},init:function(){Residential=new Micro.Residential(this);Commercial=new Micro.Commercial(this);Industrial=new Micro.Industrial(this);Road=new Micro.Road(this);Transport=new Micro.Transport(this);EmergencyServices=
|
||||
new Micro.EmergencyServices(this);MiscTiles=new Micro.MiscTiles(this);Stadia=new Micro.Stadia(this);Commercial.registerHandlers(this.mapScanner,this.repairManager);EmergencyServices.registerHandlers(this.mapScanner,this.repairManager);Industrial.registerHandlers(this.mapScanner,this.repairManager);MiscTiles.registerHandlers(this.mapScanner,this.repairManager);this.powerManager.registerHandlers(this.mapScanner,this.repairManager);Road.registerHandlers(this.mapScanner,this.repairManager);Residential.registerHandlers(this.mapScanner,
|
||||
this.repairManager);Stadia.registerHandlers(this.mapScanner,this.repairManager);Transport.registerHandlers(this.mapScanner,this.repairManager);this.evaluation.evalInit();this.valves.setValves(this.gameLevel,this.census,this.budget);this.clearCensus();this.mapScanner.mapScan(0,this.map.width,null);this.powerManager.doPowerScan(this.census,this.messageManager);Micro.pollutionTerrainLandValueScan(this.map,this.census,this.blockMaps);Micro.crimeScan(this.census,this.blockMaps);Micro.populationDensityScan(this.map,
|
||||
this.blockMaps);Micro.fireAnalysis(this.blockMaps)},simulate:function(){this.phaseCycle&=15;var a=this.speed-1;switch(this.phaseCycle){case 0:1023<++this.simCycle&&(this.simCycle=0);this.doInitialEval&&(this.doInitialEval=!1,this.evaluation.cityEvaluation());this.cityTime++;0===(this.simCycle&1)&&this.valves.setValves(this.gameLevel,this.census,this.budget);this.clearCensus();break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:this.mapScanner.mapScan((this.phaseCycle-1)*this.div,this.phaseCycle*
|
||||
this.div,null);break;case 9:0===this.cityTime%Micro.CENSUS_FREQUENCY_10&&this.census.take10Census(this.budget);0===this.cityTime%Micro.CENSUS_FREQUENCY_120&&this.census.take120Census(this.budget);0===this.cityTime%Micro.TAX_FREQUENCY&&(this.budget.collectTax(this.gameLevel,this.census,this.messageManager),this.evaluation.cityEvaluation());break;case 10:0===this.simCycle%5&&Micro.decRateOfGrowthMap(this.blockMaps);Micro.decTrafficMap(this.blockMaps);this.sendMessages();break;case 11:0===this.simCycle%
|
||||
Micro.speedPowerScan[a]&&this.powerManager.doPowerScan(this.census,this.messageManager);break;case 12:0===this.simCycle%Micro.speedPollutionTerrainLandValueScan[a]&&Micro.pollutionTerrainLandValueScan(this.map,this.census,this.blockMaps);break;case 13:0===this.simCycle%Micro.speedCrimeScan[a]&&Micro.crimeScan(this.census,this.blockMaps);break;case 14:0===this.simCycle%Micro.speedPopulationDensityScan[a]&&Micro.populationDensityScan(this.map,this.blockMaps);break;case 15:0===this.simCycle%Micro.speedFireAnalysis[a]&&
|
||||
Micro.fireAnalysis(this.blockMaps),this.disasterManager.doDisasters(this.census,this.messageManager)}this.phaseCycle=this.phaseCycle+1&15},sendMessages:function(){this.checkGrowth();var a=this.census.resZonePop+this.census.comZonePop+this.census.indZonePop,b=this.census.nuclearPowerPop+this.census.coalPowerPop;switch(this.cityTime&63){case 1:Math.floor(a/4)>=this.census.resZonePop&&this.messageManager.sendMessage(Messages.NEED_MORE_RESIDENTIAL);break;case 5:Math.floor(a/8)>=this.census.comZonePop&&
|
||||
this.messageManager.sendMessage(Messages.NEED_MORE_COMMERCIAL);break;case 10:Math.floor(a/8)>=this.census.indZonePop&&this.messageManager.sendMessage(Messages.NEED_MORE_INDUSTRIAL);break;case 14:10<a&&2*a>this.census.roadTotal&&this.messageManager.sendMessage(Messages.NEED_MORE_ROADS);break;case 18:50<a&&a>this.census.railTotal&&this.messageManager.sendMessage(Messages.NEED_MORE_RAILS);break;case 22:10<a&&0==b&&this.messageManager.sendMessage(Messages.NEED_ELECTRICITY);break;case 26:500<this.census.resPop&&
|
||||
0===this.census.stadiumPop?(this.messageManager.sendMessage(Messages.NEED_STADIUM),this.valves.resCap=!0):this.valves.resCap=!1;break;case 28:70<this.census.indPop&&0===this.census.seaportPop?(this.messageManager.sendMessage(Messages.NEED_SEAPORT),this.valves.indCap=!0):this.valves.indCap=!1;break;case 30:100<this.census.comPop&&0===this.census.airportPop?(this.messageManager.sendMessage(Messages._NEED_AIRPORT),this.valves.comCap=!0):this.valves.comCap=!1;break;case 32:a=this.census.unpoweredZoneCount+
|
||||
this.census.poweredZoneCount;0<a&&0.7>this.census.poweredZoneCount/a&&this.messageManager.sendMessage(Messages.BLACKOUTS_REPORTED);break;case 35:60<this.census.pollutionAverage&&this.messageManager.sendMessage(Messages.HIGH_POLLUTION);break;case 42:100<this.census.crimeAverage&&this.messageManager.sendMessage(Messages.HIGH_CRIME);break;case 45:60<this.census.totalPop&&0===this.census.fireStationPop&&this.messageManager.sendMessage(Messages.NEED_FIRE_STATION);break;case 48:60<this.census.totalPop&&
|
||||
0===this.census.policeStationPop&&this.messageManager.sendMessage(Messages.NEED_POLICE_STATION);break;case 51:12<this.budget.cityTax&&this.messageManager.sendMessage(Messages.TAX_TOO_HIGH);break;case 54:this.budget.roadEffect<Math.floor(5*this.budget.MAX_ROAD_EFFECT/8)&&30<this.census.roadTotal&&this.messageManager.sendMessage(Messages.ROAD_NEEDS_FUNDING);break;case 57:this.budget.fireEffect<Math.floor(7*this.budget.MAX_FIRE_STATION_EFFECT/10)&&20<this.census.totalPop&&this.messageManager.sendMessage(Messages.FIRE_STATION_NEEDS_FUNDING);
|
||||
break;case 60:this.budget.policeEffect<Math.floor(7*this.budget.MAX_POLICE_STATION_EFFECT/10)&&20<this.census.totalPop&&this.messageManager.sendMessage(Messages.POLICE_NEEDS_FUNDING);break;case 63:60<this.census.trafficAverage&&this.messageManager.sendMessage(Messages.TRAFFIC_JAMS,-1,-1,!0)}},checkGrowth:function(){if(0===(this.cityTime&3)){var a="",b=this.evaluation.getPopulation(this.census);if(0<this.cityPopLast){var c=this.evaluation.getCityClass(this.cityPopLast),d=this.evaluation.getCityClass(b);
|
||||
if(c!==d)switch(d){case Micro.CC_TOWN:a=Messages.REACHED_TOWN;break;case Micro.CC_CITY:a=Messages.REACHED_CITY;break;case Micro.CC_CAPITAL:a=Messages.REACHED_CAPITAL;break;case Micro.CC_METROPOLIS:a=Messages.REACHED_METROPOLIS;break;case Micro.CC_MEGALOPOLIS:a=Messages.REACHED_MEGALOPOLIS}}""!==a&&a!==this.messageLast&&(this.messageManager.sendMessage(a),this.messageLast=a);this.cityPopLast=b}},updateFrontEnd:function(){this.valves.changed&&(this._resLast=this.valves.resValve,this._comLast=this.valves.comValve,
|
||||
this._indLast=this.valves.indValve,this.messageManager.sendMessage(Messages.VALVES_UPDATED,{residential:this.valves.resValve,commercial:this.valves.comValve,industrial:this.valves.indValve}),this.valves.changed=!1);this.updateTime();this.evaluation.changed&&(this.messageManager.sendMessage(Messages.EVAL_UPDATED,{classification:this.evaluation.cityClass,population:this.evaluation.cityPop,score:this.evaluation.cityScore}),this.evaluation.changed=!1)},setYear:function(a){a<this.startingYear&&(a=this.startingYear);
|
||||
a=a-this.startingYear-this.cityTime/48;this.cityTime+=48*a;this.updateTime()},updateTime:function(){var a=Math.floor(this.cityTime/48)+this.startingYear,b=Math.floor(this.cityTime%48)>>2;if(1E6<=a)this.setYear(this.startingYear);else if(this._cityYearLast!==a||this._cityMonthLast!==b)this._cityYearLast=a,this._cityMonthLast=b,this.messageManager.sendMessage(Messages.DATE_UPDATED,{month:b,year:a})}};
|
3928
weboasis/arcade/3dcity/build/view.js
Normal file
146
weboasis/arcade/3dcity/build/view.min.js
vendored
Normal file
@ -0,0 +1,146 @@
|
||||
'use strict';var d=document.getElementById("debug"),miniGlCanvas=document.getElementById("miniGlCanvas"),simulation_timestep=30,stats=null,tilesData=null,spriteData=null,gameData=null,powerData=null,isMobile=!1,trans=!1,newup=!1,powerup=!1,cityWorker=new Worker("js/worker.city.js"),view3d,hub,im,isWithMiniMap=!1,storage;function debug(a){d.innerHTML+="<br>"+a}
|
||||
function testMobile(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i)?!0:!1}function init(){isMobile=testMobile();storage=window.localStorage;hub=new HUB.Base;view3d=new V3D.Base(isMobile);isWithMiniMap&&view3d.initMiniRender()}
|
||||
function loop(){requestAnimationFrame(loop);newup&&(view3d.paintMap(),view3d.moveSprite(),newup=!1);powerup&&(view3d.showPower(),powerup=!1);view3d.mouse.dragView||3===view3d.mouse.button?view3d.dragCenterposition():isMobile||view3d.updateKey();view3d.renderer.render(view3d.scene,view3d.camera);view3d.isWithStats&&view3d.runStats();isWithMiniMap&&(view3d.miniCheck(),view3d.miniRenderer.render(view3d.miniScene,view3d.topCamera))}
|
||||
function saveGame(){var a=[];view3d.saveCityBuild(a);a=JSON.stringify(a);cityWorker.postMessage({tell:"SAVEGAME",saveCity:a})}function loadGame(a){cityWorker.postMessage({tell:"LOADGAME",isStart:a||!1})}function makeGameSave(a,b){window.localStorage.setItem(b,a);console.log("game is save")}
|
||||
function makeLoadGame(a,b){var c=b||!1;b&&hub.initGameHub();var e=window.localStorage.getItem(a);e?(cityWorker.postMessage({tell:"MAKELOADGAME",savegame:e,isStart:c}),console.log("game is load")):console.log("No loading game found")}function newGameMap(){console.log("new map")}function displayStats(){view3d.isWithStats=!0}function hideStats(){view3d.isWithStats=!1}var ARRAY_TYPE;ARRAY_TYPE||(ARRAY_TYPE="undefined"!==typeof Float32Array?Float32Array:Array);function start(){initCity()}
|
||||
function setTimeColors(a){view3d.setTimeColors(a)}function newMap(){view3d.isWithHeight&&view3d.resetHeight();cityWorker.postMessage({tell:"NEWMAP"})}function newHeightMap(){view3d.isWithHeight=!0;cityWorker.postMessage({tell:"NEWMAP"})}function playMap(){hub.initGameHub();view3d.startZoom();cityWorker.postMessage({tell:"PLAYMAP"})}function selectTool(a){view3d.selectTool(a)}function sendTool(a){cityWorker.postMessage({tell:"TOOL",name:a})}
|
||||
function setDifficulty(a){cityWorker.postMessage({tell:"DIFFICULTY",n:a})}function setSpeed(a){cityWorker.postMessage({tell:"SPEED",n:a})}function getBudjet(){cityWorker.postMessage({tell:"BUDGET"})}function setBudjet(a){cityWorker.postMessage({tell:"NEWBUDGET",budgetData:a})}function getEval(){cityWorker.postMessage({tell:"EVAL"})}function setDisaster(a){console.log(a);cityWorker.postMessage({tell:"DISASTER",disaster:a})}function setOverlays(a){}
|
||||
function destroy(a,b){cityWorker.postMessage({tell:"DESTROY",x:a,y:b})}function mapClick(){var a=view3d.pos;0<a.x&&0<a.z&&cityWorker.postMessage({tell:"MAPCLICK",x:a.x,y:a.z})}function initCity(){hub.subtitle.innerHTML="Generating world...";loop();cityWorker.postMessage=cityWorker.webkitPostMessage||cityWorker.postMessage;cityWorker.postMessage({tell:"INIT",url:document.location.href.replace(/\/[^/]*$/,"/")+"build/city.3d.min.js",timestep:simulation_timestep})}
|
||||
cityWorker.onmessage=function(a){var b=a.data.tell;"NEWMAP"==b&&(tilesData=a.data.tilesData,view3d.paintMap(a.data.mapSize,a.data.island,!0),hub.start());"FULLREBUILD"==b&&(a.data.isStart&&view3d.startZoom(),view3d.fullRedraw=!0,tilesData=a.data.tilesData,view3d.paintMap(a.data.mapSize,a.data.island,!0,!0),view3d.loadCityBuild(a.data.cityData));"BUILD"==b&&view3d.build(a.data.x,a.data.y);"RUN"==b&&(tilesData=a.data.tilesData,powerData=a.data.powerData,spriteData=a.data.sprites,hub.updateCITYinfo(a.data.infos),
|
||||
newup=!0,powerData&&(powerup=!0));"BUDGET"==b&&hub.openBudget(a.data.budgetData);"QUERY"==b&&hub.openQuery(a.data.queryTxt);"EVAL"==b&&hub.openEval(a.data.evalData);"SAVEGAME"==b&&makeGameSave(a.data.gameData,a.data.key);"LOADGAME"==b&&makeLoadGame(a.data.key,a.data.isStart)};var Audio,THREE,V3D={REVISION:"0.4",Base:function(a,b,c){this.metalness=0.8;this.roughness=0.5;this.wireframe=!1;this.envType="base";this.M_list=["treeLists","townLists","houseLists","buildingLists"];this.M_temp=["tempTreeLayers","temptownLayers","tempHouseLayers","tempBuildingLayers"];this.M_geom=["treeGeo","buildingGeo","houseGeo","X"];this.M_mesh=["treeMeshs","townMeshs","houseMeshs","buildingMeshs"];this.M_mats=["townMaterial","townMaterial","buildingMaterial","buildingMaterial"];this.pix=b||
|
||||
1;this.isLow=c||!1;this.container=document.getElementById("container");this.isMobile=a||!1;this.isWithEnv=this.isWithLight=this.isWithTree=!0;this.isWithNormal=!1;this.isWithFog=!0;this.isWinter=this.isIsland=!1;this.isTransGeo=this.isComputeVertex=!0;this.key=[0,0,0,0,0,0,0];if(this.isMobile||this.isLow)this.isWithLight=this.isWithNormal=this.isWithEnv=this.isWithTree=!1;this.f=[0,0,0];this.stats=[0,0];this.isWithStats=!1;this.dayTime=0;this.tcolor={r:10,g:15,b:80,a:0.9};this.snd_layzone=new Audio("./sound/layzone.mp3");
|
||||
this.imgSrc=["img/tiles32.png","img/town.jpg","img/building.jpg","img/w_building.png","img/w_town.png","img/env/"+this.envType+".jpg"];this.imgSrcPlus=["img/tiles32_w.png","img/town_w.jpg","img/building_w.jpg"];this.winterMapLoaded=!1;this.rootModel="img/world.sea";this.imgs=[];this.num=0;this.fullRedraw=!1;this.isWithBackground=!0;this.deepthTest=this.isColorTest=this.isWithHeight=!1;this.mu=2;this.ToRad=Math.PI/180;this.topCamera=this.camera=null;this.topCameraDistance=100;this.miniRenderer=this.mapCanvas=
|
||||
this.imageSrc=this.timer=this.renderer=this.scene=null;this.miniSize={w:200,h:200};this.miniCanvas=[];this.miniCtx=[];this.miniCanvasN=[];this.miniCtxN=[];this.txtNeedUpdate=[];this.miniTerrain=[];this.terrainTxt=[];this.forceUpdate={x:-1,y:-1};this.Bulldoze=!1;this.cam={horizontal:90,vertical:45,distance:120};this.vsize={x:window.innerWidth,y:window.innerHeight,z:window.innerWidth/window.innerHeight};this.mouse={ox:0,oy:0,h:0,v:0,mx:0,my:0,dx:0,dy:0,down:!1,over:!1,drag:!1,click:!1,move:!0,dragView:!1,
|
||||
button:0};this.pos={x:-1,y:0,z:-1};this.select="";this.meshs={};this.mapSize=[128,128];this.nlayers=64;this.tool=this.terrain=null;this.toolSet=[{id:0,tool:"none",geo:0,name:"",build:0,size:0,sy:0,price:0,color:"none",drag:0},{id:1,tool:"residential",geo:1,name:"R",build:1,size:3,sy:0.2,price:100,color:"lime",drag:0},{id:2,tool:"commercial",geo:2,name:"C",build:1,size:3,sy:0.2,price:100,color:"blue",drag:0},{id:3,tool:"industrial",geo:3,name:"I",build:1,size:3,sy:0.2,price:100,color:"yellow",drag:0},
|
||||
{id:4,tool:"police",geo:4,name:"",build:1,size:3,sy:1.2,price:500,color:"blue",drag:0},{id:5,tool:"park",geo:5,name:"",build:1,size:1,sy:0.02,price:10,color:"darkgreen",drag:0},{id:6,tool:"fire",geo:7,name:"",build:1,size:3,sy:1.2,price:500,color:"red",drag:0},{id:7,tool:"road",geo:0,name:"",build:0,size:1,sy:0.1,price:10,color:"black",drag:1},{id:8,tool:"bulldozer",geo:0,name:"",build:0,size:1,sy:0,price:1,color:"deeppink",drag:1},{id:9,tool:"rail",geo:0,name:"",build:0,size:1,sy:0.15,price:20,color:"brown",
|
||||
drag:1},{id:10,tool:"coal",geo:8,name:"",build:1,size:4,sy:2,price:3E3,color:"gray",drag:0},{id:11,tool:"wire",geo:0,name:"",build:0,size:1,sy:0.05,price:5,color:"khaki",drag:1},{id:12,tool:"nuclear",geo:9,name:"",build:1,size:4,sy:2,price:5E3,color:"orange",drag:0},{id:13,tool:"port",geo:10,name:"",build:1,size:4,sy:0.5,price:3E3,color:"dodgerblue",drag:0},{id:14,tool:"stadium",geo:11,name:"",build:1,size:4,sy:2,price:5E3,color:"yellowgreen",drag:0},{id:15,tool:"airport",geo:12,name:"",build:1,size:6,
|
||||
sy:0.5,price:1E4,color:"lightblue",drag:0},{id:16,tool:"none",geo:0,name:"",build:0,size:0,sy:0,price:0,color:"none",drag:0},{id:17,tool:"query",geo:0,name:"?",build:0,size:1,sy:0,price:0,color:"cyan",drag:0},{id:18,tool:"none",geo:0,name:"",build:0,size:0,sy:0,price:0,color:"none",drag:0}];this.heightData=this.currentTool=null;this.tempHeightLayers=[];this.houseGeo=this.treeGeo=this.spriteGeo=this.industrialGeo=this.commercialGeo=this.residentialGeo=this.buildingGeo=this.buildingMap=this.townMap=
|
||||
this.buildingHeigth=this.townHeigth=this.skyCanvasBasic=this.skyCanvas=this.groundCanvas=this.buildingCanvas=this.townCanvas=this.buildingMaterial=this.townMaterial=this.skyTexture=this.buildingTexture=this.serviceTexture=this.centralTexture=this.worldTexture=null;this.treeMeshs=[];this.treeLists=[];this.tempTreeLayers=[];this.treeDeepMeshs=[];this.treeValue=[];this.powerMeshs=[];this.powerMaterial=null;this.buildingMeshs=[];this.buildingLists=[];this.tempBuildingLayers=[];this.townMeshs=[];this.townLists=
|
||||
[];this.temptownLayers=[];this.houseMeshs=[];this.houseLists=[];this.tempHouseLayers=[];this.buildingStaticMeshs=[];this.buildingStaticLists=[];this.H=[249,250,251,252,253,254,255,256,257,258,259,260];this.R=[244,265,274,283,292,301,310,319,328,337,346,355,364,373,382,391,400,409,418];this.C=[427,436,445,454,463,475,481,490,499,508,517,526,535,544,553,562,571,580,589,598,607];this.I=[616,625,634,643,652,661,670,679,688];this.tilesUpdateList=[];this.tempDestruct=[];this.currentLayer=0;this.spriteLists=
|
||||
"train elico plane boat monster tornado sparks".split(" ");this.spriteMeshs=[];this.spriteObjs={};this.loadImages()}};
|
||||
V3D.Base.prototype={constructor:V3D.Base,init:function(){this.clock=new THREE.Clock;this.scene=new THREE.Scene;this.camera=new THREE.PerspectiveCamera(55,this.vsize.z,0.1,1E3);this.scene.add(this.camera);this.rayVector=new THREE.Vector2(0,0);this.raycaster=new THREE.Raycaster;this.land=new THREE.Group;this.scene.add(this.land);this.isWithFog&&(this.fog=new THREE.Fog(13401958,1,100),this.scene.fog=this.fog);this.center=new THREE.Vector3;this.center.x=0.5*this.mapSize[0];this.center.z=0.5*this.mapSize[1];
|
||||
this.moveCamera();this.ease=new THREE.Vector3;this.easeRot=new THREE.Vector3;this.powerMaterial=new THREE.SpriteMaterial({map:this.powerTexture(),transparent:!0});var a=new THREE.WebGLRenderer({precision:"mediump",antialias:!1});a.setSize(this.vsize.x,this.vsize.y);a.setPixelRatio(this.pix||window.devicePixelRatio);a.sortObjects=!1;a.sortElements=!1;a.autoClear=this.isWithBackground;a.gammaInput=!0;a.gammaOutput=!0;this.container.appendChild(a.domElement);this.renderer=a;this.isWithLight&&(a=new THREE.DirectionalLight(16777214,
|
||||
0.6),a.position.set(this.center.x+100,300,this.center.z-100),a.target.position.set(this.center.x,this.center.y,this.center.z),this.scene.add(a),a=new THREE.HemisphereLight(6711014,251658239,1),a.position.set(0,20,0),this.scene.add(a),this.hemiLight=a);this.isWithBackground?(this.skyCanvasBasic=this.gradTexture([[0.51,0.49,0.3],["#cc7f66","#A7DCFA","deepskyblue"]]),this.skyCanvas=this.gradTexture([[0.51,0.49,0.3],["#cc7f66","#A7DCFA","deepskyblue"]]),this.skyTexture=new THREE.Texture(this.skyCanvas),
|
||||
this.skyTexture.needsUpdate=!0,this.back=new THREE.Mesh(new THREE.IcosahedronGeometry(300,1),new THREE.MeshBasicMaterial({map:this.skyTexture,side:THREE.BackSide,depthWrite:!1,fog:!1})),this.scene.add(this.back),this.renderer.autoClear=!1):this.renderer.setClearColor(13401958,1);window.addEventListener("resize",function(a){this.resize()}.bind(this),!1);document.addEventListener("contextmenu",function(a){a.preventDefault()},!1);document.addEventListener("mousewheel",this,!1);this.container.addEventListener("mousemove",
|
||||
this,!1);this.container.addEventListener("mousedown",this,!1);this.container.addEventListener("touchmove",this,!1);this.container.addEventListener("touchstart",this,!1);this.container.addEventListener("touchend",this,!1);document.addEventListener("mouseup",this,!1);this.isMobile||this.bindKeys();start();this.loadImagesPlus()},handleEvent:function(a){switch(a.type){case "mouseup":case "mouseout":case "touchend":this.onMouseUp(a);break;case "mousedown":case "touchstart":this.onMouseDown(a);break;case "mousemove":case "touchmove":this.onMouseMove(a);
|
||||
break;case "mousewheel":this.onMouseWheel(a)}},runStats:function(){this.f[1]=Date.now();this.f[1]-1E3>this.f[0]&&(this.f[0]=this.f[1],hub.upStats(this.f[2],this.renderer.info.memory.geometries),this.f[2]=0);this.f[2]++},render:function(){this.isWithStats&&this.runStats();this.renderer.render(this.scene,this.camera);this.deepthTest&&this.miniRender()},initMiniRender:function(){this.minibuilding=this.miniTree=null;this.miniTreeUpdate=0;this.townHeigth=this.customShader();this.miniScene=new THREE.Scene;
|
||||
this.topCamera=new THREE.OrthographicCamera(-5,5,5,-5,0.1,200);this.topCameraDistance=10;this.miniScene.add(this.topCamera);this.miniRenderer=new THREE.WebGLRenderer({canvas:miniGlCanvas,precision:"lowp",antialias:!1});this.miniRenderer.setSize(this.miniSize.w,this.miniSize.h,!0);this.miniRenderer.sortObjects=!1;this.miniRenderer.sortElements=!1;this.deepthTest=!0},customShader:function(){return new THREE.ShaderMaterial({uniforms:{deep:{type:"f",value:0.1}},attributes:{},vertexShader:"uniform float deep;\nvarying float dy;\nvarying vec4 vc;\nvoid main(void) {\ngl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\ndy = position.y*deep;\nvc = vec4(dy,dy,dy, 1.0);\n}",
|
||||
fragmentShader:"precision lowp float;\nvarying vec4 vc;\nvoid main(void) { gl_FragColor = vc; }"})},miniClear:function(){for(var a=this.miniScene.children.length,b;a--;)b=this.miniScene.children[a],b.geometry&&(b.geometry.dispose(),this.miniScene.remove(b))},miniClearMesh:function(a){a.geometry.dispose();this.miniScene.remove(a)},miniCheck:function(){var a=this.findLayer(this.center.x,this.center.z);a!==this.currentLayer?(this.currentLayer=a,this.miniUpTree(a),this.miniUpBuilding(a)):1==this.miniTreeUpdate&&
|
||||
(this.miniUpTree(a),this.miniTreeUpdate=0)},miniUpTree:function(a){null!==this.miniTree&&this.miniClearMesh(this.miniTree);this.miniTree=new THREE.Mesh(this.treeMeshs[a].geometry.clone(),this.townHeigth);this.miniScene.add(this.miniTree)},miniUpBuilding:function(a){this.buildingMeshs[a]&&(null!==this.minibuilding&&this.miniClearMesh(this.minibuilding),this.minibuilding=new THREE.Mesh(this.buildingMeshs[a].geometry.clone(),this.townHeigth),this.miniScene.add(this.minibuilding))},miniRender:function(){this.deepthTest&&
|
||||
(this.miniCheck(),this.miniRenderer.render(this.miniScene,this.topCamera))},resize:function(){this.vsize={x:window.innerWidth,y:window.innerHeight,z:window.innerWidth/window.innerHeight};this.camera.aspect=this.vsize.z;this.camera.updateProjectionMatrix();this.renderer.setSize(this.vsize.x,this.vsize.y)},startZoom:function(){this.timer=setInterval(this.faddingZoom,1E3/60,this)},faddingZoom:function(a){20<a.cam.distance?(a.cam.distance--,a.moveCamera()):clearInterval(a.timer)},loadImages:function(){var a=
|
||||
this,b=this.num;this.imgs[b]=new Image;this.imgs[b].onload=function(){a.num++;1===a.num&&null!==hub&&(hub.subtitle.innerHTML="Loading textures ...");a.num===a.imgSrc.length?(a.changeTextures(),a.num=0):a.loadImages()};this.imgs[b].src=this.imgSrc[b]},loadImagesPlus:function(){var a=this,b=this.num+5;this.imgs[b]=new Image;this.imgs[b].src=this.imgSrcPlus[this.num];this.imgs[b].onload=function(){a.num++;a.num===a.imgSrcPlus.length?a.winterMapLoaded=!0:a.loadImagesPlus()}},winterSwitch:function(){this.isWinter=
|
||||
!this.isWinter&&this.winterMapLoaded?!0:!1;this.updateBackground();this.setTimeColors(this.dayTime)},changeTextures:function(){this.envCanvas=document.createElement("canvas");this.groundCanvas=document.createElement("canvas");this.townCanvas=document.createElement("canvas");this.buildingCanvas=document.createElement("canvas");this.envCanvas.width=this.envCanvas.height=this.imgs[5].width;this.groundCanvas.width=this.groundCanvas.height=this.imgs[0].width;this.townCanvas.width=this.townCanvas.height=
|
||||
this.imgs[1].width;this.buildingCanvas.width=this.buildingCanvas.height=this.imgs[2].width;this.tint(this.envCanvas,this.imgs[5]);this.tint(this.groundCanvas,this.imgs[0]);this.tint(this.townCanvas,this.imgs[1],this.imgs[4]);this.tint(this.buildingCanvas,this.imgs[2],this.imgs[3]);this.imageSrc=this.groundCanvas;this.createTextures()},createTextures:function(){this.isWithEnv&&(this.environment=new THREE.Texture(this.envCanvas),this.environment.mapping=THREE.SphericalReflectionMapping,this.environment.needsUpdate=
|
||||
!0);this.townTexture=new THREE.Texture(this.townCanvas);this.townTexture.flipY=!1;this.townTexture.needsUpdate=!0;this.buildingTexture=new THREE.Texture(this.buildingCanvas);this.buildingTexture.flipY=!1;this.buildingTexture.needsUpdate=!0;this.isWithLight?(new THREE.Vector2(2,2),this.townMaterial=new THREE.MeshStandardMaterial({map:this.townTexture,metalness:this.metalness,roughness:this.roughness,wireframe:this.wireframe}),this.buildingMaterial=new THREE.MeshStandardMaterial({map:this.buildingTexture,
|
||||
metalness:this.metalness,roughness:this.roughness,wireframe:this.wireframe})):(this.townMaterial=new THREE.MeshBasicMaterial({map:this.townTexture}),this.buildingMaterial=new THREE.MeshBasicMaterial({map:this.buildingTexture}));this.isWithEnv&&(this.townMaterial.envMap=this.environment,this.buildingMaterial.envMap=this.environment);this.isWithNormal&&this.addNormalMap();this.loadSea3d()},addNormalMap:function(){this.buildingTexture_n=new THREE.Texture(this.imgs[6]);this.buildingTexture_n.flipY=!1;
|
||||
this.buildingTexture_n.needsUpdate=!0;this.townTexture_n=new THREE.Texture(this.imgs[7]);this.townTexture_n.flipY=!1;this.townTexture_n.needsUpdate=!0;this.ground_n=this.imgs[8];this.townMaterial.normalMap=this.townTexture_n;this.buildingMaterial.normalMap=this.buildingTexture_n},textureSwitch:function(a){switch(a){case "normal":this.townMaterial.map=this.townTexture,this.buildingMaterial.map=this.buildingTexture}},setTimeColors:function(a){this.dayTime=a;1==this.dayTime&&(this.tcolor={r:100,g:15,
|
||||
b:80,a:0.3});2==this.dayTime&&(this.tcolor={r:10,g:15,b:80,a:0.8});3==this.dayTime&&(this.tcolor={r:10,g:15,b:80,a:0.6});this.tint(this.skyCanvas);this.isWinter?(this.tint(this.groundCanvas,this.imgs[5]),this.tint(this.townCanvas,this.imgs[6],this.imgs[4]),this.tint(this.buildingCanvas,this.imgs[7],this.imgs[3])):(this.tint(this.groundCanvas,this.imgs[0]),this.tint(this.townCanvas,this.imgs[1],this.imgs[4]),this.tint(this.buildingCanvas,this.imgs[2],this.imgs[3]));this.isWithFog&&(this.isIsland?this.isWinter?
|
||||
(0==this.dayTime&&this.fog.color.setHex(11529966),1==this.dayTime&&this.fog.color.setHex(10005439),2==this.dayTime&&this.fog.color.setHex(2833520),3==this.dayTime&&this.fog.color.setHex(5007503)):(0==this.dayTime&&this.fog.color.setHex(6711014),1==this.dayTime&&this.fog.color.setHex(6638777),2==this.dayTime&&this.fog.color.setHex(1843310),3==this.dayTime&&this.fog.color.setHex(3093132)):this.isWinter?(0==this.dayTime&&this.fog.color.setHex(15134975),1==this.dayTime&&this.fog.color.setHex(12561610),
|
||||
2==this.dayTime&&this.fog.color.setHex(3554419),3==this.dayTime&&this.fog.color.setHex(6449558)):(0==this.dayTime&&this.fog.color.setHex(14849133),1==this.dayTime&&this.fog.color.setHex(12348516),2==this.dayTime&&this.fog.color.setHex(3484246),3==this.dayTime&&this.fog.color.setHex(6308956)));this.buildingTexture.needsUpdate=!0;this.townTexture.needsUpdate=!0;this.fullRedraw=this.skyTexture.needsUpdate=!0},loadSea3d:function(){var a=this,b=new THREE.SEA3D;b.onComplete=function(c){for(var e=b.meshes.length;e--;)c=
|
||||
b.meshes[e],c.material.dispose(),a.meshs[c.name]=c;a.defineGeometry()};b.load(this.rootModel);null!==hub&&(hub.subtitle.innerHTML="Loading 3d model ...")},defineGeometry:function(){var a,b=this.meshs;this.buildingGeo=[];this.buildingGeo[0]=null;this.buildingGeo[1]=null;this.buildingGeo[2]=null;this.buildingGeo[3]=null;this.buildingGeo[4]=b.police.geometry;this.buildingGeo[5]=b.park_1.geometry;this.buildingGeo[6]=b.park_2.geometry;this.buildingGeo[7]=b.fire.geometry;this.buildingGeo[8]=b.coal.geometry;
|
||||
this.buildingGeo[9]=b.nuclear.geometry;this.buildingGeo[10]=b.port.geometry;this.buildingGeo[11]=b.stadium.geometry;this.buildingGeo[12]=b.airport.geometry;this.residentialGeo=[];this.commercialGeo=[];this.industrialGeo=[];this.houseGeo=[];for(a=9;a--;)this.industrialGeo[a]=b["i_0"+a].geometry;for(a=19;a--;)this.residentialGeo[a]=10>a?b["r_0"+a].geometry:b["r_"+a].geometry;for(a=21;a--;)this.commercialGeo[a]=10>a?b["c_0"+a].geometry:b["c_"+a].geometry;for(a=12;a--;)this.houseGeo[a]=10>a?b["rh_0"+
|
||||
a].geometry:b["rh_"+a].geometry;this.spriteGeo=[];this.spriteGeo[0]=b.train.geometry;this.spriteGeo[1]=b.elico.geometry.clone();this.spriteGeo[2]=b.plane.geometry.clone();this.treeGeo=[];this.treeGeo[0]=b.ttt3.geometry;this.treeGeo[1]=b.ttt3.geometry.clone();this.treeGeo[2]=b.ttt4.geometry;this.treeGeo[3]=b.ttt4.geometry.clone();this.treeGeo[4]=b.ttt0.geometry;this.treeGeo[5]=b.ttt1.geometry;this.treeGeo[6]=b.ttt2.geometry;this.treeGeo[7]=b.ttt5.geometry;this.init()},getRandomObject:function(){var a,
|
||||
b;switch(this.randRange(0,6)){case 0:a=this.buildingGeo[this.randRange(4,12)];b=this.townMaterial;break;case 1:a=this.residentialGeo[this.randRange(1,this.residentialGeo.length-1)];b=this.buildingMaterial;break;case 2:a=this.commercialGeo[this.randRange(1,this.commercialGeo.length-1)];b=this.buildingMaterial;break;case 3:a=this.industrialGeo[this.randRange(1,this.industrialGeo.length-1)];b=this.buildingMaterial;break;case 4:a=this.houseGeo[this.randRange(0,this.houseGeo.length-1)];b=this.buildingMaterial;
|
||||
break;case 5:a=this.spriteGeo[this.randRange(0,this.spriteGeo.length-1)];b=this.townMaterial;break;case 6:a=this.randRange(0,2),b=0,1==a&&(b=4),2==a&&(b=6),a=this.treeGeo[b],b=this.townMaterial}b=new THREE.Mesh(a.clone(),b.clone());b.name=a.name;return b},randRange:function(a,b){return Math.floor(Math.random()*(b-a+1))+a},buildMeshLayer:function(a,b){b=b||"tree";var c=0;"tree"===b&&(c=0);"town"===b&&(c=1);"house"===b&&(c=2);"building"===b&&(c=3);var e=this.M_list[c],f=this.M_temp[c],h=this.M_geom[c],
|
||||
g=this.M_mesh[c],l=this.M_mats[c],k,p,q,n,m,v,s,t,u,r,w=0;if(this[e][a]){v=this[e][a].length;p=[];n=[];for(q=[];v--;){r=this[e][a][v];if(3===c){for(m=this.R.length;m--;)r[3]===this.R[m]&&(k=this.residentialGeo[m],0===m&&0===r[5]?(this.buildingLists[a][v][5]=1,this.addBaseHouse(r[0],r[1],r[2])):0<m&&1===r[5]&&(this.buildingLists[a][v][5]=0,this.removeBaseHouse(r[0],r[1],r[2])));for(m=this.C.length;m--;)r[3]===this.C[m]&&(k=this.commercialGeo[m]);for(m=this.I.length;m--;)r[3]===this.I[m]&&(k=this.industrialGeo[m])}else if(2===
|
||||
c)for(m=this.H.length;m--;)r[3]===this.H[m]&&(k=this.houseGeo[m]);else{if(8===r[3]||9===r[3]||10===r[3]||11===r[3])w=1;12===r[3]&&(w=3);k=this[h][r[3]]}if(k){m=k.attributes.position.array;t=m.length/3;for(s=0;s<t;s++)u=3*s,p.push(m[u]+r[0]),p.push(m[u+1]+r[1]),p.push(-m[u+2]+r[2]+w);m=k.attributes.normal.array;t=m.length/3;for(s=0;s<t;s++)u=3*s,q.push(m[u]),q.push(m[u+1]),q.push(-m[u+2]);m=k.attributes.uv.array;t=m.length;for(s=0;s<t;s++)n.push(m[s])}}this[g][a]&&(this.scene.remove(this[g][a]),this[g][a].geometry.dispose());
|
||||
0<p.length&&(c=new THREE.BufferGeometry,c.addAttribute("position",new THREE.BufferAttribute(new Float32Array(p),3)),c.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(q),3)),c.addAttribute("uv",new THREE.BufferAttribute(new Float32Array(n),2)),this[g][a]=new THREE.Mesh(c,this[l]),this.scene.add(this[g][a]));this[f][a]=0}},addTree:function(a,b,c,e,f){this.isWithTree&&(this.treeLists[f]||(this.treeLists[f]=[]),this.treeLists[f].push([a,b,c,e]))},populateTree:function(){if(this.isWithTree)for(var a=
|
||||
this.nlayers;a--;)this.buildMeshLayer(a)},clearAllTrees:function(){if(this.isWithTree){for(var a=this.nlayers;a--;)this.treeMeshs[a]&&(this.scene.remove(this.treeMeshs[a]),this.treeMeshs[a].geometry&&this.treeMeshs[a].geometry.dispose());this.treeMeshs=[];this.treeLists=[];this.tempTreeLayers=[]}},removeTreePack:function(a){if(this.isWithTree){for(var b=a.length;b--;)this.removeTree(a[b][0],a[b][1],!0);for(b=this.tempTreeLayers.length;b--;)1===this.tempTreeLayers[b]&&this.rebuildTreeLayer(b)}},removeTree:function(a,
|
||||
b,c){var e=this.findLayer(a,b),f;if(this.treeLists[e])for(var h=this.treeLists[e].length;h--;)if(f=this.treeLists[e][h],f[0]==a&&f[2]==b)if(this.treeLists[e].splice(h,1),c)this.tempTreeLayers[e]=1;else{this.rebuildTreeLayer(e);break}},rebuildTreeLayer:function(a){this.isWithTree&&(this.scene.remove(this.treeMeshs[a]),this.treeMeshs[a].geometry.dispose(),this.buildMeshLayer(a),a==this.currentLayer&&(this.miniTreeUpdate=1))},updateBackground:function(){var a,b;this.isWithBackground?(this.isIsland?(a=
|
||||
"#6666e6",b=6711014,this.isWinter&&(a="#AFEEEE",b=11529966)):(a="#E2946D",b=14849133,this.isWinter&&(a="#E6F0FF",b=15134975)),this.skyCanvasBasic=this.gradTexture([[0.51,0.49,0.3],[a,"#BFDDFF","#4A65FF"]]),this.skyCanvas=this.gradTexture([[0.51,0.49,0.3],[a,"#BFDDFF","#4A65FF"]]),this.isWithFog&&this.fog.color.setHex(b),this.skyTexture=new THREE.Texture(this.skyCanvas),this.skyTexture.needsUpdate=!0,this.back.material.map=this.skyTexture):this.isIsland?this.renderer.setClearColor(6711014,1):this.renderer.setClearColor(13401958,
|
||||
1);this.isWithLight&&this.hemiLight.groundColor.setHex(b)},updateTerrain:function(a){this.isIsland=a||!1;this.center.x=0.5*this.mapSize[0];this.center.z=0.5*this.mapSize[1];this.updateBackground();if(0===this.miniTerrain.length){a=0;for(var b=[0,2228224,4456448,6684672,8912896,11141120,13369344,16711680],c=[0,8704,17408,26112,34816,43520,52224,65280],e=0;8>e;e++)for(var f=0;8>f;f++){var h;h=this.isWithHeight?new THREE.PlaneBufferGeometry(16,16,16,16):new THREE.PlaneBufferGeometry(16,16,1,1);h.rotateX(0.5*
|
||||
-Math.PI);for(var g=h.attributes.position.array,l=g.length/3;l--;){var k=3*l;g[k]+=8+16*f-0.5;g[k+2]+=8+16*e-0.5}this.miniTerrain[a]=this.isColorTest?new THREE.Mesh(h,new THREE.MeshBasicMaterial({color:b[e]+c[f]})):this.isWithLight?new THREE.Mesh(h,new THREE.MeshStandardMaterial({color:16777215,metalness:this.metalness,roughness:this.roughness,wireframe:this.wireframe})):new THREE.Mesh(h,new THREE.MeshBasicMaterial({color:16777215}));this.isWithEnv&&(this.miniTerrain[a].material.envMap=this.environment);
|
||||
this.land.add(this.miniTerrain[a]);a++}}for(a=this.miniTerrain.length;a--;)b=new THREE.Texture(this.miniCanvas[a]),b.needsUpdate=!0,this.miniTerrain[a].material.map=b,this.isWithNormal&&(c=new THREE.Texture(this.miniCanvasN[a]),c.needsUpdate=!0,this.miniTerrain[a].material.normalMap=c),this.terrainTxt[a]=b;this.isWithHeight?(this.applyHeight(),this.center.y=this.heightData[this.findHeightId(this.center.x,this.center.z)]):this.center.y=0;this.moveCamera();this.back.position.copy(this.center)},generateHeight:function(){if(0!=
|
||||
this.miniTerrain.length){for(var a=this.miniTerrain.length;a--;)this.land.remove(this.miniTerrain[a]);this.miniTerrain=[]}this.bigG=new THREE.PlaneBufferGeometry(128,128,128,128);this.bigG.rotateX(0.5*-Math.PI);for(var a=this.bigG.attributes.position.array,b=a.length/3;b--;){var c=3*b;a[c]+=this.center.x;a[c+2]+=this.center.z}for(var e,f,b=new ARRAY_TYPE(16641),c=new Perlin,h=1/129,g=3+2*Math.random(),a=16641;a--;)e=a%129,f=~~(a*h),e=c.noise(0.05*e,0.05*f),b[a]=(0.5+0.5*e)*g;return b},resetHeight:function(){for(var a=
|
||||
this.heightData.length;a--;)this.heightData[a]=0;this.applyHeight();this.isWithHeight=!1},findHeightId:function(a,b){return this.findSamePoint(a,b)},findSamePoint:function(a,b){var c;c=this.bigG?this.bigG.attributes.position.array:this.positionRef;for(var e=c.length/3,f,h=0;e--;)if(f=3*e,c[f]===a&&c[f+2]===b){h=e;break}return h},applyHeight:function(){var a,b,c,e,f,h;this.Gtmp=[];c=this.bigG.attributes.position.array;for(a=c.length/3;a--;)f=3*a,c[f+1]=this.heightData[a];this.bigG.attributes.position.needUpdate=
|
||||
!0;this.bigG.computeVertexNormals();this.positionRef=new Float32Array(c.length);for(a=c.length;a--;)this.positionRef[a]=c[a];var g=this.bigG.attributes.normal.array;for(a=64;a--;)this.Gtmp[a]=new ARRAY_TYPE(289);for(a=64;a--;){c=this.miniTerrain[a].geometry.attributes.position.array;e=this.miniTerrain[a].geometry.attributes.normal.array;for(b=c.length/3;b--;)f=3*b,h=this.findSamePoint(c[f]+0.5,c[f+2]+0.5),this.Gtmp[b]=this.heightData[h],c[f+1]=this.Gtmp[b],h*=3,e[f]=g[h],e[f+1]=g[h+1],e[f+2]=g[h+
|
||||
2];this.miniTerrain[a].geometry.attributes.position.needUpdate=!0;this.miniTerrain[a].geometry.attributes.normal.needUpdate=!0}this.bigG.dispose();this.bigG=null},makePlanar:function(a,b){},updateVertices:function(a,b){for(var c=a.attributes.position.array,e=b.length,f;e--;)f=3*e,c[f+1]=b[e];a.attributes.position.needUpdate=!0},findPositionDisp:function(a){var b=Math.floor(a/129);return[a-Math.floor(129*b),b]},findLayerDisp:function(a,b){return Math.floor(a/16)+8*Math.floor(b/16)},findVerticesDisp:function(a,
|
||||
b){var c=0,c=Math.floor(a/8);return c=b[0]-16*Math.floor(a-8*c)+16*(b[1]-16*c)},findLayer:function(a,b){return Math.floor(a/16)+8*Math.floor(b/16)},findLayerPos:function(a,b,c){var e=Math.floor(c/8);return[a-16*Math.floor(c-8*e),b-16*e]},findPosition:function(a){var b=Math.floor(a/this.mapSize[1]);return[a-b*this.mapSize[1],b]},findId:function(a,b){return a+b*this.mapSize[1]},findVertices:function(a,b){var c=0,c=Math.floor(a/8);return c=b[0]-16*Math.floor(a-8*c)+16*(b[1]-16*c)},rayTest:function(){this.raycaster.setFromCamera(this.rayVector,
|
||||
this.camera);if(0<this.land.children.length){var a=this.raycaster.intersectObjects(this.land.children);0<a.length?(this.pos.x=Math.round(a[0].point.x),this.pos.z=Math.round(a[0].point.z),this.pos.y=this.isWithHeight?Math.round(a[0].point.y):0,this.currentTool&&(this.tool.position.set(this.pos.x,this.pos.y,this.pos.z),(this.mouse.click||this.mouse.drag)&&mapClick(),this.mouse.click=!1)):(this.pos.x=-1,this.pos.z=-1)}},selectTool:function(a){this.pos.x=-1;this.pos.z=-1;null!==this.tool&&this.removeTool();
|
||||
0===a||18===a?(this.currentTool=null,this.mouse.dragView=!1,this.mouse.move=!0):16===a?(this.currentTool=null,this.mouse.move=!1,this.mouse.dragView=!0):(this.currentTool=this.toolSet[a],this.mouse.move=!1,this.mouse.dragView=!1,this.tool=this.customTool(),this.scene.add(this.tool));sendTool(this.toolSet[a].tool)},customTool:function(){var a=this.currentTool.size,b=this.currentTool.color,c=0.5*a,e=0;4==a?e=0.5:6==a&&(e=1.5);a=new THREE.Geometry;c=[new THREE.Vector3(-c+e,0.02,-c+e),new THREE.Vector3(-c+
|
||||
e,0.02,c+e),new THREE.Vector3(c+e,0.02,c+e),new THREE.Vector3(c+e,0.02,-c+e)];a.vertices.push(c[0],c[1],c[1],c[2],c[2],c[3],c[3],c[0]);b=new THREE.LineSegments(a,new THREE.LineBasicMaterial({color:b,linewidth:3,depthWrite:!1,depthTest:!1}));b.overdraw=!0;return b},build:function(a,b){if("query"!==this.currentTool.tool)if(this.currentTool.build){var c=this.currentTool.size,e=0;this.isWithHeight&&(e=this.heightData[this.findHeightId(a,b)]);var f;1==c?f=[[a,b]]:3==c?f=[[a,b],[a-1,b],[a+1,b],[a,b-1],
|
||||
[a-1,b-1],[a+1,b-1],[a,b+1],[a-1,b+1],[a+1,b+1]]:4==c?f=[[a,b],[a-1,b],[a+1,b],[a,b-1],[a-1,b-1],[a+1,b-1],[a,b+1],[a-1,b+1],[a+1,b+1],[a+2,b-1],[a+2,b],[a+2,b+1],[a+2,b+2],[a-1,b+2],[a,b+2],[a+1,b+2]]:6==c&&(f=[[a,b],[a-1,b],[a+1,b],[a,b-1],[a-1,b-1],[a+1,b-1],[a,b+1],[a-1,b+1],[a+1,b+1],[a+2,b-1],[a+2,b],[a+2,b+1],[a+2,b+2],[a-1,b+2],[a,b+2],[a+1,b+2],[a+3,b-1],[a+4,b-1],[a+3,b],[a+4,b],[a+3,b+1],[a+4,b+1],[a+3,b+2],[a+4,b+2],[a+3,b+3],[a+4,b+3],[a+3,b+4],[a+4,b+4],[a-1,b+3],[a-1,b+4],[a,b+3],[a,
|
||||
b+4],[a+1,b+3],[a+1,b+4],[a+2,b+3],[a+2,b+4]]);this.removeTreePack(f);this.cleanGround(f);this.isWithHeight&&this.makePlanar(f,e);c=this.currentTool.geo;4>c&&0!==c&&(this.addBaseBuilding(a,e,b,c,f),this.snd_layzone.play());if(8==c||9==c||4==c||5==c||7==c||10==c||11==c||12==c)this.addBaseTown(a,e,b,c,f),this.snd_layzone.play()}else this.removeTree(a,b),this.isWithHeight&&(e=this.heightData[this.findHeightId(a,b)],this.makePlanar([[a,b]],e)),"bulldozer"==this.currentTool.tool&&(this.forceUpdate.x=a,
|
||||
this.forceUpdate.y=b,this.testDestruct(a,b))},removeTool:function(){this.scene.remove(this.tool);this.tool.geometry.dispose();this.currentTool=this.tool=null},testLayer:function(a,b){var c=this.findLayer(a,b),e=[c],f=this.findLayerPos(a,b,c),h=0,g=0;4>f[0]?h=1:13<f[0]&&(h=2);4>f[1]?g=1:13<f[1]&&(g=2);1==g&&-1<c-8&&e.push(c-8);2==g&&64>c+8&&e.push(c+8);1==h&&-1<c-1&&e.push(c-1);2==h&&64>c+1&&e.push(c+1);1==h&&1==g&&-1<c-9&&e.push(c-9);2==h&&2==g&&64>c+9&&e.push(c+9);1==h&&2==g&&64>c+7&&e.push(c+7);
|
||||
2==h&&1==g&&-1<c-7&&e.push(c-7);return e},testDestruct:function(a,b){for(var c,e,f,h,g,l=this.testLayer(a,b),k=0;k<l.length;k++){g=l[k];if(this.townLists[g])for(c=this.townLists[g].length;c--;)for(f=this.townLists[g][c],h=f[4],e=h.length;e--;)if(a==h[e][0]&&b==h[e][1]){this.showDestruct(f);destroy(h[0][0],h[0][1]);this.townLists[g].splice(c,1);this.rebuildTownLayer(g);return}if(this.buildingLists[g])for(c=this.buildingLists[g].length;c--;)for(f=this.buildingLists[g][c],h=f[4],e=h.length;e--;)if(a==
|
||||
h[e][0]&&b==h[e][1]){this.showDestruct(f);destroy(h[0][0],h[0][1]);1===f[5]&&this.removeBaseHouse(f[0],f[1],f[2]);this.buildingLists[g].splice(c,1);this.rebuildBuildingLayer(g);return}}},showDestruct:function(a){this.tempDestruct=a[4]},addBaseTown:function(a,b,c,e,f){var h=this.findLayer(a,c);this.townLists[h]||(this.townLists[h]=[]);this.townLists[h].push([a,b,c,e,f]);this.rebuildTownLayer(h)},rebuildTownLayer:function(a){this.buildMeshLayer(a,"town")},addBaseHouse:function(a,b,c){var e=this.findLayer(a,
|
||||
c);a=[[a,c],[a-1,c],[a+1,c],[a,c-1],[a-1,c-1],[a+1,c-1],[a,c+1],[a-1,c+1],[a+1,c+1]];this.houseLists[e]||(this.houseLists[e]=[]);for(c=9;c--;)this.houseLists[e].push([a[c][0],b,a[c][1],0])},removeBaseHouse:function(a,b,c){b=this.findLayer(a,c);a=[[a,c],[a-1,c],[a+1,c],[a,c-1],[a-1,c-1],[a+1,c-1],[a,c+1],[a-1,c+1],[a+1,c+1]];c=this.houseLists[b].length;for(var e,f;c--;)for(e=this.houseLists[b][c],f=9;f--;)e[0]===a[f][0]&&e[2]===a[f][1]&&this.houseLists[b].splice(c,1);this.rebuildHouseLayer(b)},rebuildHouseLayer:function(a){this.buildMeshLayer(a,
|
||||
"house")},addBaseBuilding:function(a,b,c,e,f){var h=this.findLayer(a,c),g=244;2==e&&(g=427);3==e&&(g=616);this.buildingLists[h]||(this.buildingLists[h]=[]);this.buildingLists[h].push([a,b,c,g,f,0]);this.rebuildBuildingLayer(h)},rebuildBuildingLayer:function(a){this.buildMeshLayer(a,"building")},saveCityBuild:function(a){for(var b=this.nlayers;b--;)a[b]=[0,0,0],void 0!==this.townLists[b]&&(a[b][0]=this.townLists[b]),void 0!==this.houseLists[b]&&(a[b][1]=this.houseLists[b]),void 0!==this.buildingLists[b]&&
|
||||
(a[b][2]=this.buildingLists[b])},loadCityBuild:function(a){a=JSON.parse(a);for(var b=this.nlayers,c;b--;)c=a[b],0!==c[0]&&(this.townLists[b]=c[0],this.rebuildTownLayer(b)),0!==c[1]&&(this.houseLists[b]=c[1],this.rebuildHouseLayer(b)),0!==c[2]&&(this.buildingLists[b]=c[2],this.rebuildBuildingLayer(b))},Orbit:function(a,b,c,e){var f=new THREE.Vector3;87<c&&(c=87);1>c&&(c=1);c*=this.ToRad;b*=this.ToRad;f.x=e*Math.sin(c)*Math.cos(b)+a.x;f.z=e*Math.sin(c)*Math.sin(b)+a.z;f.y=e*Math.cos(c)+a.y;return f},
|
||||
unwrapDegrees:function(a){a%=360;180<a&&(a-=360);-180>a&&(a+=360);return a},moveCamera:function(){this.camera.position.copy(this.Orbit(this.center,this.cam.horizontal,this.cam.vertical,this.cam.distance));this.camera.lookAt(this.center);this.isWithFog&&(this.fog.far=4*this.cam.distance,20>this.fog.far&&(this.fog.far=20));this.deepthTest&&(this.topCamera.position.set(this.center.x,this.topCameraDistance,this.center.z),this.topCamera.lookAt(this.center))},dragCenterposition:function(){if(0!=this.ease.x||
|
||||
0!=this.ease.z)this.easeRot.y=this.cam.horizontal*this.ToRad,this.unwrapDegrees(Math.round(this.cam.horizontal)),this.easeRot.x=Math.sin(this.easeRot.y)*this.ease.x+Math.cos(this.easeRot.y)*this.ease.z,this.easeRot.z=Math.cos(this.easeRot.y)*this.ease.x-Math.sin(this.easeRot.y)*this.ease.z,this.center.x+=this.easeRot.x,this.center.z-=this.easeRot.z,0>this.center.x&&(this.center.x=0),128<this.center.x&&(this.center.x=128),0>this.center.z&&(this.center.z=0),128<this.center.z&&(this.center.z=128),this.moveCamera()},
|
||||
onMouseDown:function(a){a.preventDefault();var b,c;a.touches?(b=a.clientX||a.touches[0].pageX,c=a.clientY||a.touches[0].pageY):(b=a.clientX,c=a.clientY,this.mouse.button=a.which);this.mouse.ox=b;this.mouse.oy=c;this.rayVector.x=b/this.vsize.x*2-1;this.rayVector.y=2*-(c/this.vsize.y)+1;this.mouse.h=this.cam.horizontal;this.mouse.v=this.cam.vertical;this.mouse.down=!0;this.currentTool&&2>this.mouse.button&&(this.mouse.click=!0,this.currentTool.drag&&(this.mouse.drag=!0))},onMouseUp:function(a){a.preventDefault();
|
||||
this.mouse.button=0;this.mouse.down=!1;this.mouse.drag=!1;null==this.currentTool&&(this.mouse.move=!0);this.ease.x=0;this.ease.z=0;document.body.style.cursor="auto"},onMouseMove:function(a){a.preventDefault();var b;a.touches?(b=a.clientX||a.touches[0].pageX,a=a.clientY||a.touches[0].pageY):(b=a.clientX,a=a.clientY);if(this.mouse.down){if(this.mouse.move||2===this.mouse.button)this.mouse.dragView=!1,document.body.style.cursor="crosshair",this.cam.horizontal=0.3*(b-this.mouse.ox)+this.mouse.h,this.cam.vertical=
|
||||
0.3*-(a-this.mouse.oy)+this.mouse.v,this.moveCamera();if(this.mouse.dragView||3===this.mouse.button)document.body.style.cursor="move",this.mouse.move=!1,this.ease.x=(b-this.mouse.ox)/1E3,this.ease.z=(a-this.mouse.oy)/1E3}null!==this.currentTool&&(this.rayVector.x=b/this.vsize.x*2-1,this.rayVector.y=2*-(a/this.vsize.y)+1,this.rayTest())},onMouseWheel:function(a){a.preventDefault();var b=0;a.wheelDelta?b=-1*a.wheelDelta:a.detail&&(b=20*a.detail);this.cam.distance+=b/80;1>this.cam.distance&&(this.cam.distance=
|
||||
1);150<this.cam.distance&&(this.cam.distance=150);this.moveCamera()},cleanGround:function(a){for(var b=a.length,c,e,f,h,g;b--;)e=a[b][0],f=a[b][1],h=Math.floor(e/16),g=Math.floor(f/16),c=h+8*g,this.miniCtx[c].drawImage(this.imageSrc,0,0,16*this.mu,16*this.mu,16*(e-16*h)*this.mu,16*(f-16*g)*this.mu,16*this.mu,16*this.mu),this.txtNeedUpdate[c]=1},paintMap:function(a,b,c,e){if(tilesData){a&&(this.mapSize=a);c?(this.treeValue=[],this.clearAllTrees(),this.isWithHeight&&(this.heightData=this.generateHeight())):
|
||||
(this.tempBuildingLayers=[],this.tempHouseLayers=[]);if(0===this.miniCanvas.length)for(var f=0;f<this.nlayers;f++)this.miniCanvas[f]=document.createElement("canvas"),this.miniCanvas[f].width=this.miniCanvas[f].height=256*this.mu,this.miniCtx[f]=this.miniCanvas[f].getContext("2d"),this.isWithNormal&&(this.miniCanvasN[f]=document.createElement("canvas"),this.miniCanvasN[f].width=this.miniCanvasN[f].height=256*this.mu,this.miniCtxN[f]=this.miniCanvasN[f].getContext("2d")),this.txtNeedUpdate[f]=0;a=!1;
|
||||
e=this.mapSize[1];for(var h,g,l,k,p=tilesData.length,q,n,m=0;e--;)for(h=this.mapSize[0];h--;)if(f=Math.floor(e/16),q=Math.floor(h/16),n=q+8*f,p--,g=tilesData[p],c&&(1<g&&5>g&&this.isWithHeight&&(this.heightData[this.findHeightId(h,e)]=-0.1),5<g&&21>g&&this.isWithHeight&&(this.heightData[this.findHeightId(h,e)]*=0.5),20<g&&44>g&&(this.isWithHeight&&(m=this.heightData[this.findHeightId(h,e)]-0.1),l=Math.floor(4*Math.random()),36<=g&&(l+=4),c&&this.addTree(h,m,e,l,n),g=this.isWithTree?21+l:29+l,this.treeValue[p]=
|
||||
g)),this.fullRedraw&&20<g&&44>g&&(g=this.treeValue[p]),l=g%32*16,k=16*Math.floor(g/32),c||this.fullRedraw)this.miniCtx[n].drawImage(this.imageSrc,l*this.mu,k*this.mu,16*this.mu,16*this.mu,16*(h-16*q)*this.mu,16*(e-16*f)*this.mu,16*this.mu,16*this.mu),this.isWithNormal&&this.miniCtxN[n].drawImage(this.ground_n,l*this.mu,k*this.mu,16*this.mu,16*this.mu,16*(h-16*q)*this.mu,16*(e-16*f)*this.mu,16*this.mu,16*this.mu);else if(h===this.forceUpdate.x&&e===this.forceUpdate.y&&(a=!0,this.forceUpdate.x=-1,this.forceUpdate.y=
|
||||
-1),43<g&&240>g||a)a&&(a=!1,20<g&&44>g&&(k=l=0)),this.miniCtx[n].drawImage(this.imageSrc,l*this.mu,k*this.mu,16*this.mu,16*this.mu,16*(h-16*q)*this.mu,16*(e-16*f)*this.mu,16*this.mu,16*this.mu),this.isWithNormal&&this.miniCtxN[n].drawImage(this.ground_n,l*this.mu,k*this.mu,16*this.mu,16*this.mu,16*(h-16*q)*this.mu,16*(e-16*f)*this.mu,16*this.mu,16*this.mu),this.txtNeedUpdate[n]=1;else if(240<g||0==g)if(248<g&&261>g||0==g){if(this.houseLists[n])for(f=this.houseLists[n].length;f--;)q=this.houseLists[n][f],
|
||||
q[0]===h&&q[2]===e&&q[3]!==g&&(this.houseLists[n][f][3]=g,this.tempHouseLayers[n]=1)}else if(this.buildingLists[n])for(f=this.buildingLists[n].length;f--;)q=this.buildingLists[n][f],q[0]===h&&q[2]===e&&q[3]!==g&&(this.buildingLists[n][f][3]=g,this.tempBuildingLayers[n]=1);if(c)this.updateTerrain(b),this.populateTree();else{for(f=this.nlayers;f--;)if(this.txtNeedUpdate[f]||this.fullRedraw)this.terrainTxt[f].needsUpdate=!0,this.txtNeedUpdate[f]=0;for(f=this.tempHouseLayers.length;f--;)1===this.tempHouseLayers[f]&&
|
||||
this.rebuildHouseLayer(f);for(f=this.tempBuildingLayers.length;f--;)1===this.tempBuildingLayers[f]&&this.rebuildBuildingLayer(f)}this.fullRedraw&&(this.fullRedraw=!1)}},moveSprite:function(){if(spriteData)for(var a=spriteData.length,b=new THREE.Vector3,c=0,e=0;a--;){var f=spriteData[a],c=f[1],e=f[0];b.x=Math.round((f[2]-8)/16);b.z=Math.round((f[3]-8)/16);b.y=0;this.isWithHeight&&(b.y=this.heightData[this.findHeightId(b.x,b.z)]);2==f[0]&&(b.y+=5);3==f[0]&&(b.y=11==c?b.y+0:10==c?b.y+1:9==c?b.y+3:b.y+
|
||||
6);null==this.spriteObjs[this.spriteLists[e]]&&(this.spriteObjs[this.spriteLists[e]]=this.addSprite(e,b));this.spriteObjs[this.spriteLists[e]].visible=1===e&&5===c?!1:!0;this.spriteObjs[this.spriteLists[e]].position.lerp(b,0.6);this.spriteObjs[this.spriteLists[e]].rotation.y=this.rotationSprite(f[0],c)}},rotationSprite:function(a,b){var c=0;if(1===a)1===b?c=0:2===b?c=90*this.ToRad:3===b?c=45*this.ToRad:4===b&&(c=-45*this.ToRad);else if(2===a||3===a)1===b?c=0:2===b?c=-45*this.ToRad:3===b?c=-90*this.ToRad:
|
||||
4===b?c=-135*this.ToRad:5===b?c=-180*this.ToRad:6===b?c=-225*this.ToRad:7===b?c=-270*this.ToRad:8===b?c=-315*this.ToRad:9===b?c=-90*this.ToRad:10===b?c=-90*this.ToRad:11===b&&(c=-90*this.ToRad);return c},addSprite:function(a,b){var c;c=1===a?new THREE.Mesh(this.spriteGeo[0],this.townMaterial):2===a?new THREE.Mesh(this.spriteGeo[1],this.townMaterial):3===a?new THREE.Mesh(this.spriteGeo[2],this.townMaterial):new THREE.Mesh(new THREE.BoxGeometry(1,1,1),this.townMaterial);c.position.copy(b);this.scene.add(c);
|
||||
return c},showPower:function(){if(powerData)for(var a=powerData.length;a--;)2==powerData[a]?null==this.powerMeshs[a]&&this.addPowerMesh(a,this.findPosition(a)):1==powerData[a]&&null!==this.powerMeshs[a]&&this.removePowerMesh(a)},addPowerMesh:function(a,b){var c=0;this.isWithHeight&&(c=this.heightData[this.findHeightId(b[0],b[1])]);var e=new THREE.Sprite(this.powerMaterial);e.position.set(b[0],c+1,b[1]);this.scene.add(e);this.powerMeshs[a]=e},removePowerMesh:function(a){this.scene.remove(this.powerMeshs[a]);
|
||||
this.powerMeshs[a]=null},powerTexture:function(){var a=document.createElement("canvas"),b=a.getContext("2d");a.width=a.height=64;var c=b.createLinearGradient(0,0,64,64);c.addColorStop(0.3,"yellow");c.addColorStop(1,"red");b.beginPath();b.moveTo(44,0);b.lineTo(10,34);b.lineTo(34,34);b.lineTo(20,64);b.lineTo(54,30);b.lineTo(30,30);b.lineTo(44,0);b.closePath();b.strokeStyle="red";b.stroke();b.fillStyle=c;b.fill();a=new THREE.Texture(a);a.needsUpdate=!0;return a},gradTexture:function(a){var b=document.createElement("canvas"),
|
||||
c=b.getContext("2d");b.width=16;b.height=256;for(var e=c.createLinearGradient(0,0,0,256),f=a[0].length;f--;)e.addColorStop(a[0][f],a[1][f]);c.fillStyle=e;c.fillRect(0,0,16,256);return b},tint:function(a,b,c){var e,f,h=a.width*a.height,g=a.getContext("2d"),l=null,l=null;if(c&&0!==this.dayTime&&1!==this.dayTime){g.clearRect(0,0,a.width,a.height);g.drawImage(c,0,0);l=g.getImageData(0,0,a.width,a.height);c=l.data;for(e=h;e--;)f=e<<2,0!==c[f+3]&&(0==c[f+0]&&0==c[f+1]&&0==c[f+2]&&(c[f+3]=60),0==c[f+1]&&
|
||||
(3==this.dayTime&&(c[f+1]=255),2==this.dayTime&&(c[f+0]=0,c[f+3]=60)));g.putImageData(l,0,0);l=document.createElement("img");l.src=a.toDataURL("image/png")}b?(g.clearRect(0,0,a.width,a.height),g.drawImage(b,0,0)):g.drawImage(this.skyCanvasBasic,0,0);if(0!==this.dayTime){a=g.getImageData(0,0,a.width,a.height);c=a.data;e=h;for(h=this.tcolor;e--;)f=e<<2,c[f+0]=c[f+0]*(1-h.a)+h.r*h.a,c[f+1]=c[f+1]*(1-h.a)+h.g*h.a,c[f+2]=c[f+2]*(1-h.a)+h.b*h.a;g.putImageData(a,0,0);l&&g.drawImage(l,0,0)}},updateKey:function(){var a=
|
||||
!1;1==this.key[0]||1==this.key[1]?(1==this.key[0]&&(this.ease.z=-0.3),1==this.key[1]&&(this.ease.z=0.3),a=!0):this.ease.z=0;1==this.key[2]||1==this.key[3]?(1==this.key[2]&&(this.ease.x=-0.3),1==this.key[3]&&(this.ease.x=0.3),a=!0):this.ease.x=0;a&&this.dragCenterposition()},bindKeys:function(){var a=this;document.onkeydown=function(b){b=b||window.event;switch(b.keyCode){case 38:case 87:case 90:a.key[0]=1;break;case 40:case 83:a.key[1]=1;break;case 37:case 65:case 81:a.key[2]=1;break;case 39:case 68:a.key[3]=
|
||||
1}};document.onkeyup=function(b){b=b||window.event;switch(b.keyCode){case 38:case 87:case 90:a.key[0]=0;break;case 40:case 83:a.key[1]=0;break;case 37:case 65:case 81:a.key[2]=0;break;case 39:case 68:a.key[3]=0}};self.focus()}};var HUB={REVISION:"1",round:'<svg height="66" width="66">\n<circle cx="33" cy="33" r="27" stroke="rgb(255,255,255)" stroke-width="1" stroke-opacity="0.0" fill="rgb(0,0,0)" fill-opacity="0.1"/>\n</svg>',roundSelected:'<svg height="66" width="66">\n<circle cx="33" cy="33" r="27" stroke="rgb(255,255,255)" stroke-width="2" stroke-opacity="0.5" fill="rgb(0,0,0)" fill-opacity="0.3"/>\n</svg>',roundSelect:'<svg height="66" width="66">\n<circle cx="33" cy="33" r="30" stroke="rgb(255,255,255)" stroke-width="4" stroke-opacity="1" fill="rgb(0,0,0)" fill-opacity="0.5"/>\n</svg>',
|
||||
Base:function(){this.hub=document.getElementById("hub");this.title=this.full=null;this.isIntro=!0;this.timer=null;this.bg=1;this.I=this.C=this.R=null;this.colors="rgba(255,255,255,1) rgba(0,0,0,0.2) rgba(0,0,0,1) rgba(0,0,0,0.5) rgba(0,0,0,0.8) rgba(255,255,255,0.5)".split(" ");this.radius="-moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px;";this.radiusL="-moz-border-top-left-radius: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px;";this.radiusL+="-moz-border-bottom-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px;";
|
||||
this.radiusR="-moz-border-top-right-radius: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px;";this.radiusR+="-moz-border-bottom-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px;";this.radiusB="-moz-border-bottom-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px;";this.radiusB+="-moz-border-bottom-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px;";this.windowsStyle=
|
||||
" top:40px; left:10px; border:1px solid "+this.colors[1]+"; background:"+this.colors[3]+";";this.select=this.selector=this.aboutWindow=this.overlaysWindow=this.queryWindow=this.exitWindow=this.disasterWindow=this.evaluationWindow=this.budgetWindow=null;this.currentToolName=0;this.disasterTypes="None Monster Fire Flood Crash Meltdown Tornado".split(" ");this.disasterButtons=[];this.overlaysTypes="None;Density;Growth;Land value;Crime Rate;Pollution;Traffic;Power Grid;Fire;Police".split(";");this.overlaysButtons=
|
||||
[];this.intro()}};
|
||||
HUB.Base.prototype={constructor:HUB.Base,init:function(){},intro:function(){this.full=document.createElement("div");this.full.style.cssText="position:absolute; top:0px; left:0px; width:100%; height:100%; pointer-events:none; display:block; background:rgba(102,102,230,1); ";this.fullMid=document.createElement("div");this.fullMid.style.cssText="position:absolute; top:10px; left:50%; width:300px; height:300px; margin-left:-150px; pointer-events:none; display:block;";this.title=document.createElement("div");this.title.innerHTML=
|
||||
"3D.CITY";this.title.style.cssText="position:absolute; font-size:44px; top:50%; left:0; margin-top:-30px; width:300px; height:60px; pointer-events:none; text-align:center;";this.subtitle=document.createElement("div");this.subtitle.style.cssText="position:absolute; font-size:14px; top:50%; left:0; margin-top:20px; width:300px; height:80px; pointer-events:none; text-align:center;";this.subtitle.innerHTML="Generating world...";this.logo=document.getElementById("logo");this.logo.style.display="block";
|
||||
this.full.appendChild(this.fullMid);this.fullMid.appendChild(this.logo);this.fullMid.appendChild(this.title);this.fullMid.appendChild(this.subtitle);this.hub.appendChild(this.full)},start:function(){this.isIntro&&(this.timer=setInterval(this.fadding,100,this))},fadding:function(a){a.bg-=0.1;a.full.style.background="rgba(102,102,230,"+a.bg+")";0>=a.bg&&(clearInterval(a.timer),a.full.removeChild(a.fullMid),a.fullMid.removeChild(a.logo),a.fullMid.removeChild(a.title),a.fullMid.removeChild(a.subtitle),
|
||||
a.hub.removeChild(a.full),a.initStartHub(),a.isIntro=!1)},initStartHub:function(){this.full=document.createElement("div");this.full.style.cssText="position:absolute; top:10px; left:50%; margin-left:-150px; width:300px; height:300px; pointer-events:none;";this.full.id="fullStart";this.hub.appendChild(this.full);var a=this.addButton(this.full,"Play Game",[276,48,40],"position:absolute; top:10px; left:0px;"),b=this.addButton(this.full,"New Map",[120,26,22],"position:absolute; top:150px; left:0px;"),
|
||||
c=this.addButton(this.full,"Height Map",[120,26,22],"position:absolute; top:150px; right:0px;"),e=this.addButton(this.full,"Load Map",[276,26,22],"position:absolute; top:90px; left:0px;");this.addSelector("DIFFICULTY",["LOW","MEDIUM","HARD"],setDifficulty,0);a.addEventListener("click",function(a){a.preventDefault();playMap()},!1);b.addEventListener("click",function(a){a.preventDefault();newMap()},!1);c.addEventListener("click",function(a){a.preventDefault();newHeightMap()},!1);e.addEventListener("click",
|
||||
function(a){a.preventDefault();loadGame(!0)},!1)},initGameHub:function(){var a=this;this.removeSelector("DIFFICULTY");this.clearElement("fullStart");this.toolSet=document.createElement("div");this.toolSet.style.cssText="position:absolute; margin:0px; padding:0px; top:60px; right:12px; width:198px; height:456px; pointer-events:none;";this.hub.appendChild(this.toolSet);this.toolInfo=document.createElement("div");this.toolInfo.style.cssText="position:absolute; top:15px; right:12px; width:198px; height:50px; pointer-events:none; font-size:16px;";
|
||||
this.hub.appendChild(this.toolInfo);this.toolInfo.innerHTML="Selecte<br>Tool";for(var b,c=0;18>c;c++)b=this.addSVGButton(this.toolSet),b.name=c+1;this.selector=document.createElement("div");this.selector.style.cssText="position:absolute; top:0px; left:0px; pointer-events:none; display:none;";this.selector.innerHTML=HUB.roundSelected;this.toolSet.appendChild(this.selector);this.select=document.createElement("div");this.select.style.cssText="position:absolute; top:0px; left:0px; pointer-events:none; display:none;";
|
||||
this.select.innerHTML=HUB.roundSelect;this.toolSet.appendChild(this.select);c=document.createElement("img");c.src="img/interface.png";this.toolSet.appendChild(c);c.style.cssText="position:absolute; margin:0px; padding:0px; top:0px; right:0px; width:198px; height:396px; pointer-events:none;";this.addSelector("Speed",["II",">",">>",">>>",">>>"],setSpeed,2,[20,20,20,20,20]);this.addButton(this.hub,"Budget",[75,16,14],"position:absolute; left:10px; top:-7px; font-weight:bold;",!0).addEventListener("click",
|
||||
function(a){a.preventDefault();getBudjet()},!1);this.addButton(this.hub,"Eval",[75,16,14],"position:absolute; left:110px; top:-7px; font-weight:bold;",!0).addEventListener("click",function(a){a.preventDefault();getEval()},!1);this.addButton(this.hub,"Exit",[75,16,14],"position:absolute; left:310px; top:-7px; font-weight:bold;",!0).addEventListener("click",function(b){b.preventDefault();a.openExit()},!1);this.addButton(this.hub,"About",[75,16,14],"position:absolute; left:410px; top:-7px; font-weight:bold;",
|
||||
!0).addEventListener("click",function(b){b.preventDefault();a.openAbout()},!1);this.H=[];this.roo=document.createElement("div");this.roo.style.cssText="position:absolute; bottom:11px; left:10px; width:60px; height:60px; pointer-events:none; transform:rotate(45deg); ";this.roo.style.cssText+="-moz-border-radius: 30px; -webkit-border-radius: 30px; border-radius: 30px; overflow:hidden; ";this.hub.appendChild(this.roo);for(c=0;4>c;c++)b=document.createElement("div"),0==c&&(b.style.cssText="position:absolute; top:0px; left:0px; width:30px; height:30px; pointer-events:auto; cursor:pointer; background:#ffffff;"),
|
||||
1==c&&(b.style.cssText="position:absolute; top:0px; right:0px; width:30px; height:30px; pointer-events:auto; cursor:pointer;"),2==c&&(b.style.cssText="position:absolute; bottom:0px; right:0px; width:30px; height:30px; pointer-events:auto; cursor:pointer;"),3==c&&(b.style.cssText="position:absolute; bottom:0px; left:0px; width:30px; height:30px; pointer-events:auto; cursor:pointer;"),b.name=c,this.roo.appendChild(b),b.addEventListener("click",function(b){b.preventDefault();a.hideoldSel();a.H[this.name].style.background=
|
||||
"#ffffff";setTimeColors(this.name)},!1),this.H[c]=b;c=document.createElement("div");c.style.cssText="position:absolute; bottom:80px; left:25px; width:30px; height:30px; pointer-events:auto; cursor:pointer; background:rgba(0,0,0,0); ";c.style.cssText+="-moz-border-radius: 30px; -webkit-border-radius: 30px; border-radius: 30px; ";this.hub.appendChild(c);c.addEventListener("click",function(a){view3d.winterSwitch();this.style.background=view3d.isWinter?"rgba(255,255,255,0.5);":"rgba(0,0,0,0);"},!1);c=
|
||||
document.createElement("img");c.src="img/basemenu.png";this.hub.appendChild(c);c.style.cssText="position:absolute; margin:0px; padding:0px; bottom:0px; left:0px; width:630px; height:120px; pointer-events:none;";this.initCITYinfo()},hideoldSel:function(){for(var a=0;4>a;a++)this.H[a].style.background="none"},initCITYinfo:function(){this.date=document.createElement("div");this.date.style.cssText="font-size:14px; position:absolute; width:70px; height:19px; bottom:15px; left:65px; text-align:right; font-weight:bold;";
|
||||
this.money=document.createElement("div");this.money.style.cssText="font-size:14px; position:absolute; width:70px; height:19px; bottom:15px; left:295px; text-align:right; font-weight:bold;";this.population=document.createElement("div");this.population.style.cssText="font-size:14px; position:absolute; width:70px; height:19px; bottom:15px; left:180px; text-align:right; font-weight:bold;";this.score=document.createElement("div");this.score.style.cssText="font-size:14px; position:absolute; width:70px; height:19px; bottom:15px; left:410px; text-align:right; font-weight:bold;";
|
||||
this.msg=document.createElement("div");this.msg.style.cssText="font-size:14px; letter-spacing:0.02em; position:absolute; width:420px; height:20px; bottom:44px; left:76px; text-align:left; color:"+this.colors[4]+"; font-weight:bold;";this.hub.appendChild(this.date);this.hub.appendChild(this.money);this.hub.appendChild(this.population);this.hub.appendChild(this.score);this.hub.appendChild(this.msg);this.initRCI()},updateCITYinfo:function(a){this.date.innerHTML=a[0];this.money.innerHTML=a[4];this.population.innerHTML=
|
||||
a[3];this.score.innerHTML=a[2];this.msg.innerHTML=a[8];this.updateRCI(a[5],a[6],a[7])},testOpen:function(){var a="";null!==this.budgetWindow&&"open"==this.budgetWindow.className&&(this.closeBudget(),a="budget");null!==this.evaluationWindow&&"open"==this.evaluationWindow.className&&(this.closeEval(),a="evaluation");null!==this.disasterWindow&&"open"==this.disasterWindow.className&&(this.closeDisaster(),a="disaster");null!==this.exitWindow&&"open"==this.exitWindow.className&&(this.closeExit(),a="exit");
|
||||
null!==this.queryWindow&&"open"==this.queryWindow.className&&(this.closeQuery(),a="query");null!==this.overlaysWindow&&"open"==this.overlaysWindow.className&&(this.closeOverlays(),a="overlays");null!==this.aboutWindow&&"open"==this.aboutWindow.className&&(this.closeAbout(),a="about");return a},openAbout:function(a){var b=this;"about"!=this.testOpen()&&(null==this.aboutWindow?(this.aboutWindow=document.createElement("div"),this.aboutWindow.style.cssText=this.radius+"position:absolute; width:200px; height:210px; pointer-events:none; display:block;"+
|
||||
this.windowsStyle,this.hub.appendChild(this.aboutWindow),this.addButton(this.aboutWindow,"X",[16,16,14],"position:absolute; left:10px; top:10px;").addEventListener("click",function(a){a.preventDefault();b.closeAbout()},!1),this.fps=document.createElement("div"),this.fps.style.cssText="position:absolute; top:20px; left:60px; width:120px; height:20px; pointer-events:none; font-size:12px; text-align:center; color:"+this.colors[0]+";",this.aboutWindow.appendChild(this.fps),this.abb=document.createElement("div"),
|
||||
this.abb.style.cssText="position:absolute; top:60px; left:10px; width:180px; height:180px; pointer-events:none; font-size:12px; text-align:center; color:"+this.colors[0]+";",this.aboutWindow.appendChild(this.abb),this.linke=document.createElement("div"),this.linke.style.cssText="position:absolute; top:160px; left:10px; width:180px; height:20px; pointer-events:auto; font-size:12px; text-align:center; color:"+this.colors[0]+";",this.aboutWindow.appendChild(this.linke),this.abb.innerHTML="3D CITY<br><br>All 3d side made by Lo.th<br>Simulation from MicropolisJS<br>",
|
||||
this.linke.innerHTML="<a href='https://WebOas.is' target='_blank'>https://WebOas.is"):this.aboutWindow.style.display="block",displayStats(),this.aboutWindow.className="open")},upStats:function(a,b){this.fps.innerHTML="Fps: "+a+" <br> geometry: "+b},closeAbout:function(){hideStats();this.aboutWindow.style.display="none";this.aboutWindow.className="close"},openOverlays:function(a){if("overlays"!=this.testOpen()){if(null==this.overlaysWindow)for(this.overlaysWindow=document.createElement("div"),
|
||||
this.overlaysWindow.style.cssText=this.radius+"position:absolute; width:140px; height:420px; pointer-events:none; display:block;"+this.windowsStyle,this.hub.appendChild(this.overlaysWindow),a=0;a<this.overlaysTypes.length;a++)this.overlaysButtons[a]=this.addButton(this.overlaysWindow,this.overlaysTypes[a].toUpperCase(),[96,16,14],"position:absolute; left:10px; top:"+(10+40*a)+"px;"),this.overlaysButtons[a].name=this.overlaysTypes[a],this.overlaysButtons[a].addEventListener("click",function(a){a.preventDefault();
|
||||
setOverlays(this.name)},!1);else this.overlaysWindow.style.display="block";this.overlaysWindow.className="open"}},closeOverlays:function(){this.overlaysWindow.style.display="none";this.overlaysWindow.className="close"},openQuery:function(a){var b=this;null==this.queryWindow?(this.queryWindow=document.createElement("div"),this.queryWindow.style.cssText=this.radius+"position:absolute; width:140px; height:180px; pointer-events:none; display:block;"+this.windowsStyle,this.hub.appendChild(this.queryWindow),
|
||||
this.addButton(this.queryWindow,"X",[16,16,14],"position:absolute; left:50px; top:10px;").addEventListener("click",function(a){a.preventDefault();b.closeQuery()},!1),this.queryResult=document.createElement("div"),this.queryResult.style.cssText="position:absolute; top:60px; left:10px; width:110px; height:100px; pointer-events:none; font-size:12px; text-align:center; color:"+this.colors[0]+";",this.queryWindow.appendChild(this.queryResult)):this.queryWindow.style.display="block";this.queryResult.innerHTML=
|
||||
a;this.queryWindow.className="open"},closeQuery:function(){this.queryWindow.style.display="none";this.queryWindow.className="close"},openEval:function(a){"evaluation"!=this.testOpen()&&(null==this.evaluationWindow?(this.evaluationWindow=document.createElement("div"),this.evaluationWindow.style.cssText=this.radius+"position:absolute; width:200px; height:300px; pointer-events:none; display:block;"+this.windowsStyle,this.hub.appendChild(this.evaluationWindow),this.evaltOpinion=document.createElement("div"),
|
||||
this.evaltOpinion.style.cssText="position:absolute; top:10px; left:10px; width:180px; height:100px; pointer-events:none; color:"+this.colors[0]+";",this.evaluationWindow.appendChild(this.evaltOpinion),this.evaltYes=document.createElement("div"),this.evaltYes.style.cssText="position:absolute; top:46px; left:26px; width:60px; height:20px; pointer-events:none; color:#33FF33; font-size:16px; font-weight:bold;",this.evaluationWindow.appendChild(this.evaltYes),this.evaltNo=document.createElement("div"),
|
||||
this.evaltNo.style.cssText="position:absolute; top:46px; right:26px; width:60px; height:20px; pointer-events:none; color:#FF3300; font-size:16px; font-weight:bold;",this.evaluationWindow.appendChild(this.evaltNo),this.evaltProb=document.createElement("div"),this.evaltProb.style.cssText="position:absolute; top:100px; left:10px; width:180px; height:60px; pointer-events:none; color:"+this.colors[0]+"; font-size:16px; ",this.evaluationWindow.appendChild(this.evaltProb),this.evaltOpinion.innerHTML="<b>Public opinion</b><br>Is the mayor doing a good job ?<br> <br> <br> <br>What are the worst problems ?<br>"):
|
||||
this.evaluationWindow.style.display="block",this.evaltYes.innerHTML="YES:"+a[0]+"%",this.evaltNo.innerHTML="NO:"+(100-a[0])+"%",this.evaltProb.innerHTML=a[1],this.evaluationWindow.className="open")},closeEval:function(){this.evaluationWindow.style.display="none";this.evaluationWindow.className="close"},openExit:function(a){var b=this;if("exit"!=this.testOpen()){if(null==this.exitWindow){this.exitWindow=document.createElement("div");this.exitWindow.style.cssText=this.radius+"position:absolute; width:140px; height:180px; pointer-events:none; display:block;"+
|
||||
this.windowsStyle;this.hub.appendChild(this.exitWindow);a=this.addButton(this.exitWindow,"X",[16,16,14],"position:absolute; left:50px; top:10px;");var c=this.addButton(this.exitWindow,"NEW MAP",[96,16,14],"position:absolute; left:10px; top:50px;"),e=this.addButton(this.exitWindow,"SAVE",[96,16,14],"position:absolute; left:10px; top:90px;"),f=this.addButton(this.exitWindow,"LOAD",[96,16,14],"position:absolute; left:10px; top:130px;");a.addEventListener("click",function(a){a.preventDefault();b.closeExit()},
|
||||
!1);c.addEventListener("click",function(a){a.preventDefault();newGameMap()},!1);e.addEventListener("click",function(a){a.preventDefault();saveGame()},!1);f.addEventListener("click",function(a){a.preventDefault();loadGame()},!1)}else this.exitWindow.style.display="block";this.exitWindow.className="open"}},closeExit:function(){this.exitWindow.style.display="none";this.exitWindow.className="close"},openBudget:function(a){var b=this;if("budget"!=this.testOpen()){this.dataKeys="roadFund roadRate fireFund fireRate policeFund policeRate taxRate totalFunds taxesCollected".split(" ");
|
||||
for(var c=this.dataKeys.length;c--;)this[this.dataKeys[c]]=a[this.dataKeys[c]];a=a.taxesCollected;c=a-this.roadFund-this.fireFund-this.policeFund;if(null==this.budgetWindow){this.budgetWindow=document.createElement("div");this.budgetWindow.style.cssText=this.radius+"position:absolute; width:200px; height:300px; pointer-events:none; display:block;"+this.windowsStyle;this.hub.appendChild(this.budgetWindow);this.addSlider(this.budgetWindow,10,"Tax",this.taxRate,null,"green",20);this.addSlider(this.budgetWindow,
|
||||
70,"Roads",this.roadRate,this.roadFund,"red",100);this.addSlider(this.budgetWindow,110,"Fire",this.fireRate,this.fireFund,"red",100);this.addSlider(this.budgetWindow,150,"Police",this.policeRate,this.policeFund,"red",100);this.budgetResult=document.createElement("div");this.budgetResult.style.cssText="position:absolute; top:200px; left:10px; width:180px; height:300px; pointer-events:none; color:"+this.colors[0]+";";this.budgetWindow.appendChild(this.budgetResult);var e=this.addButton(this.budgetWindow,
|
||||
"CLOSE",[70,16,14],"position:absolute; left:10px; bottom:10px;"),f=this.addButton(this.budgetWindow,"APPLY",[70,16,14],"position:absolute; rigth:10px; bottom:10px;");e.addEventListener("click",function(a){a.preventDefault();b.closeBudget()},!1);f.addEventListener("click",function(a){a.preventDefault();b.applyBudget()},!1)}else this.budgetWindow.style.display="block",this.setBudgetValue();this.budgetResult.innerHTML="Annual receipts:"+c+"$<br>Taxes collected:"+a+"$";this.budgetWindow.className="open"}},
|
||||
applyBudget:function(){this.budgetWindow.style.display="none";this.budgetWindow.className="close";setBudjet([this.taxRate,this.roadRate,this.fireRate,this.policeRate])},closeBudget:function(){this.budgetWindow.style.display="none";this.budgetWindow.className="close"},setBudgetValue:function(){this.setSliderValue("Tax",this.taxRate,20,null);this.setSliderValue("Roads",this.roadRate,100,this.roadFund);this.setSliderValue("Fire",this.fireRate,100,this.fireFund);this.setSliderValue("Police",this.policeRate,
|
||||
100,this.policeFund)},openDisaster:function(){if("disaster"!=this.testOpen()){if(null==this.disasterWindow){this.disasterWindow=document.createElement("div");this.disasterWindow.style.cssText=this.radius+"position:absolute; width:140px; height:300px; pointer-events:none; display:block;"+this.windowsStyle;this.hub.appendChild(this.disasterWindow);for(var a=0;a<this.disasterTypes.length;a++)this.disasterButtons[a]=this.addButton(this.disasterWindow,this.disasterTypes[a].toUpperCase(),[96,16,14],"position:absolute; left:10px; top:"+
|
||||
(10+40*a)+"px;"),this.disasterButtons[a].name=this.disasterTypes[a],this.disasterButtons[a].addEventListener("click",function(a){a.preventDefault();setDisaster(this.name)},!1)}else this.disasterWindow.style.display="block";this.disasterWindow.className="open"}},closeDisaster:function(){this.disasterWindow.style.display="none";this.disasterWindow.className="close"},addSlider:function(a,b,c,e,f,h,g){var l=this,k=document.createElement("div"),p=document.createElement("div"),q=document.createElement("div");
|
||||
k.style.cssText="position:absolute; left:10px; top:-18px; pointer-events:none; width:180px; height:20px; font-size:12px; color:"+this.colors[0]+";";p.style.cssText=this.radius+"position:absolute; left:10px; top:"+(b+20)+"px; padding:0; cursor:w-resize; pointer-events:auto; width:180px; height:20px; background-color:"+l.colors[1]+";";q.style.cssText=this.radius+"position:absolute; pointer-events:none; margin:5px; width:100px; height:10px; background-color:"+h+";";a.appendChild(p);p.appendChild(q);
|
||||
p.appendChild(k);p.name=c;p.id=c;k.innerHTML=null!==f?c+" "+e+"% of "+f+"$ = "+Math.floor(e/100*f)+"$":c+" "+e+"%";q.style.width=e/g*170+"px";p.className="up";p.addEventListener("mouseout",function(a){a.preventDefault();this.className="up";this.style.backgroundColor=l.colors[1]},!1);p.addEventListener("mouseover",function(a){a.preventDefault();this.style.backgroundColor=l.colors[2]},!1);p.addEventListener("mouseup",function(a){a.preventDefault();this.className="up"},!1);p.addEventListener("mousedown",
|
||||
function(a){a.preventDefault();this.className="down";l.dragSlider(this,a.clientX,g)},!1);p.addEventListener("mousemove",function(a){a.preventDefault();l.dragSlider(this,a.clientX,g)},!1)},setSliderValue:function(a,b,c,e){var f=document.getElementById(a).childNodes;f[0].style.width=b/c*170+"px";f[1].innerHTML=null!==e?a+" "+b+"% of "+e+"$ = "+Math.floor(b/100*e)+"$":a+" "+b+"%"},dragSlider:function(a,b,c){if("down"==a.className){var e=a.childNodes,f=a.getBoundingClientRect();b=Math.round((b-f.left)/
|
||||
170*c);0>b&&(b=0);b>c&&(b=c);e[0].style.width=b/c*170+"px";switch(a.name){case "Tax":e[1].innerHTML=a.name+" "+b+"%";this.taxRate=b;break;case "Roads":e[1].innerHTML=a.name+" "+b+"% of "+this.roadFund+"$ = "+Math.floor(b/100*this.roadFund)+"$";this.roadRate=b;break;case "Fire":e[1].innerHTML=a.name+" "+b+"% of "+this.fireFund+"$ = "+Math.floor(b/100*this.fireFund)+"$";this.fireRate=b;break;case "Police":e[1].innerHTML=a.name+" "+b+"% of "+this.policeFund+"$ = "+Math.floor(b/100*this.policeFund)+"$",
|
||||
this.policeRate=b}}},initRCI:function(){var a=document.createElement("div");a.id="RCI";a.style.cssText="font-size:10px; position:absolute; width:70px; height:70px; bottom:20px; right:20px;";var b=document.createElement("div");b.style.cssText="font-size:10px; position:absolute; width:46px; height:14px; bottom:28px; left:10px; background:#cccccc; padding:0px 2px; letter-spacing:12px; text-align:center; color:#000000;";b.innerHTML="RCI";this.R=document.createElement("div");this.R.id="R";this.R.style.cssText=
|
||||
"position:absolute; width:10px; height:20px; bottom:42px; left:10px; background:#30ff30;";a.appendChild(this.R);this.C=document.createElement("div");this.C.id="C";this.C.style.cssText="position:absolute; width:10px; height:20px; bottom:42px; left:30px; background:#3030ff;";a.appendChild(this.C);this.I=document.createElement("div");this.I.id="I";this.I.style.cssText="position:absolute; width:10px; height:20px; bottom:42px; left:50px; background:#ffff30;";a.appendChild(this.I);a.appendChild(b);this.hub.appendChild(a)},
|
||||
updateRCI:function(a,b,c){this.R.style.height=a/100+"px";this.C.style.height=b/100+"px";this.I.style.height=c/100+"px";this.R.style.bottom=0<a?"42px":28+a/100+"px";this.C.style.bottom=0<b?"42px":28+b/100+"px";this.I.style.bottom=0<c?"42px":28+c/100+"px"},addSelector:function(a,b,c,e,f){var h=this,g=document.createElement("div");g.style.cssText="font-size:14px; margin-top:10px; color:"+this.colors[0]+";";"Speed"==a?g.style.cssText="font-size:20px; position:absolute; bottom:8px; left:497px; ":g.innerHTML=
|
||||
a+"<br>";g.id=a;for(var l=[],k=0;k!==b.length;k++)l[k]=document.createElement("div"),l[k].style.cssText="font-size:14px; border:1px solid "+this.colors[5]+"; background:"+this.colors[1]+"; color:"+this.colors[0]+";",l[k].style.cssText="Speed"==a?l[k].style.cssText+" width:70px; height:16px; margin-left:2px; padding:6px; pointer-events:auto; cursor:pointer; display:inline-block; ":l[k].style.cssText+" width:70px; height:16px; margin:2px; padding:7px; pointer-events:auto; cursor:pointer; display:inline-block; ",
|
||||
0==k&&(l[k].style.cssText+=this.radiusL),k==b.length-1&&(l[k].style.cssText+=this.radiusR),f?f[k]?(l[k].style.width=f[k]+"px",l[k].style.height=f[k]+"px",l[k].style.padding="0px"):l[k].style.width="60px":l[k].style.width="60px",l[k].className="none","Speed"!==a&&(l[k].textContent=b[k]),k==e&&(l[k].style.backgroundColor=this.colors[5],l[k].style.color=this.colors[2],l[k].className="select"),l[k].name=k,l[k].id=a+k,g.appendChild(l[k]),l[k].addEventListener("mouseover",function(a){a.preventDefault();
|
||||
this.style.border="1px solid "+h.colors[0]},!1),l[k].addEventListener("mouseout",function(a){a.preventDefault();this.style.border="1px solid "+h.colors[5]},!1),l[k].addEventListener("click",function(b){b.preventDefault();c(this.name);h.setActiveSelector(this.name,a)},!1);"DIFFICULTY"==a?(this.full.appendChild(g),g.style.position="absolute",g.style.top="200px",g.style.width="300px"):this.hub.appendChild(g)},setActiveSelector:function(a,b){for(var c=10,e;c--;)document.getElementById(b+c)&&(e=document.getElementById(b+
|
||||
c),e.style.color=this.colors[0],e.style.backgroundColor=this.colors[1],e.className="none");c=document.getElementById(b+a);c.style.backgroundColor=this.colors[5];c.style.color=this.colors[2];c.className="select"},removeSelector:function(a){for(var b=10,c,e=document.getElementById(a);b--;)document.getElementById(a+b)&&(c=document.getElementById(a+b),e.removeChild(c));this.full.removeChild(e)},showToolSelect:function(a){if(a.name!==this.currentToolName){this.currentToolName=a.name;var b=a.getBoundingClientRect().left-
|
||||
this.toolSet.getBoundingClientRect().left;a=a.getBoundingClientRect().top-this.toolSet.getBoundingClientRect().top;this.select.style.left=b+"px";this.select.style.top=a+"px";this.select.style.display="block"}else this.select.style.display="none",this.currentToolName=0;selectTool(this.currentToolName)},showToolInfo:function(a,b){var c=view3d.toolSet[a.name].tool,c=c.charAt(0).toUpperCase()+c.substring(1).toLowerCase();b.toolInfo.innerHTML=16===a.name?"Drag view":178===a.name?"Get info":18===a.name?
|
||||
"Rotate view":c+"<br>"+view3d.toolSet[a.name].price+"$"},addSVGButton:function(a){var b=this,c=document.createElement("div");c.style.cssText=" margin:0px; padding:0px; width:66px; height:66px; pointer-events:auto; cursor:pointer; display:inline-block; line-height:0px; vertical-align: top;";c.innerHTML=HUB.round;c.addEventListener("mouseover",function(a){a.preventDefault();a=this.getBoundingClientRect().left-b.toolSet.getBoundingClientRect().left;var c=this.getBoundingClientRect().top-b.toolSet.getBoundingClientRect().top;
|
||||
b.selector.style.left=a+"px";b.selector.style.top=c+"px";b.selector.style.display="block";b.showToolInfo(this,b)},!1);c.addEventListener("mouseout",function(a){a.preventDefault();b.selector.style.display="none"},!1);c.addEventListener("click",function(a){a.preventDefault();b.showToolSelect(this)},!1);a.appendChild(c);return c},addButton:function(a,b,c,e,f){var h=this;c||(c=[128,30,22]);var g=document.createElement("div");c="font-size:"+c[2]+"px; border:1px solid "+this.colors[5]+"; background:"+
|
||||
this.colors[1]+"; width:"+c[0]+"px; height:"+c[1]+"px; color:"+this.colors[0]+";";c=f?c+("margin:4px; padding:7px; pointer-events:auto; cursor:pointer; display:inline-block; "+this.radiusB):c+("margin:4px; padding:7px; pointer-events:auto; cursor:pointer; display:inline-block; "+this.radius);g.textContent=b;g.style.cssText=e?c+e:c+"margin-top:20px;";g.addEventListener("mouseover",function(a){a.preventDefault();this.style.backgroundColor=h.colors[5];this.style.color=h.colors[2]},!1);g.addEventListener("mouseout",
|
||||
function(a){a.preventDefault();this.style.backgroundColor=h.colors[1];this.style.color=h.colors[0]},!1);a.appendChild(g);return g},clearElement:function(a){a=document.getElementById(a);for(var b=a.childNodes,c=b.length;c--;)a.removeChild(b[c]);this.hub.removeChild(a)}};var ARRAY8="undefined"!==typeof Uint8Array?Uint8Array:Array,Perlin=function(){this.F2=0.5*(Math.sqrt(3)-1);this.G2=(3-Math.sqrt(3))/6;var a=Math.random;this.p=new ARRAY8(256);this.perm=new ARRAY8(512);this.permMod12=new ARRAY8(512);for(var b=0;256>b;b++)this.p[b]=256*a();for(b=0;512>b;b++)this.perm[b]=this.p[b&255],this.permMod12[b]=this.perm[b]%12};
|
||||
Perlin.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),noise:function(a,b){var c=this.permMod12,e=this.perm,f=this.grad3,h=0,g=0,l=0,k=(a+b)*this.F2,p=Math.floor(a+k),q=Math.floor(b+k),k=(p+q)*this.G2,n=a-(p-k),m=b-(q-k),v,s;n>m?(v=1,s=0):(v=0,s=1);var t=n-v+this.G2,u=m-s+this.G2,k=n-1+2*this.G2,r=m-1+2*this.G2,p=p&255,q=q&255,w=0.5-n*n-m*m;0<=w&&(h=3*c[p+e[q]],w*=w,h=w*w*(f[h]*n+f[h+1]*m));n=0.5-t*t-u*u;0<=n&&(g=3*c[p+v+e[q+
|
||||
s]],n*=n,g=n*n*(f[g]*t+f[g+1]*u));t=0.5-k*k-r*r;0<=t&&(c=3*c[p+1+e[q+1]],t*=t,l=t*t*(f[c]*k+f[c+1]*r));return 70*(h+g+l)}};
|
BIN
weboasis/arcade/3dcity/favicon.ico
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
weboasis/arcade/3dcity/img/basemenu.png
Normal file
After Width: | Height: | Size: 13 KiB |
346
weboasis/arcade/3dcity/img/basemenu.svg
Normal file
@ -0,0 +1,346 @@
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="none" x="0px" y="0px" width="800px" height="80px" viewBox="0 0 800 80">
|
||||
<defs>
|
||||
<linearGradient id="Gradient_1" gradientUnits="userSpaceOnUse" x1="80" y1="70" x2="80" y2="10" spreadMethod="pad">
|
||||
<stop offset="0%" stop-color="#000000" stop-opacity="0.7019607843137254"/>
|
||||
|
||||
<stop offset="47.84313725490196%" stop-color="#000000" stop-opacity="0.30196078431372547"/>
|
||||
|
||||
<stop offset="100%" stop-color="#000000" stop-opacity="0.10196078431372549"/>
|
||||
</linearGradient>
|
||||
|
||||
<radialGradient id="Gradient_2" gradientUnits="userSpaceOnUse" cx="0" cy="0" r="26.7375" fx="0" fy="0" gradientTransform="matrix( 1, 0, 0, 1, 0,0.1) " spreadMethod="pad">
|
||||
<stop offset="0%" stop-color="#4F8FFF"/>
|
||||
|
||||
<stop offset="100%" stop-color="#003399"/>
|
||||
</radialGradient>
|
||||
|
||||
<radialGradient id="Gradient_3" gradientUnits="userSpaceOnUse" cx="0" cy="0" r="26.7375" fx="0" fy="0" gradientTransform="matrix( 1, 0, 0, 1, 0,0.1) " spreadMethod="pad">
|
||||
<stop offset="0%" stop-color="#7BB3FF"/>
|
||||
|
||||
<stop offset="100%" stop-color="#2C5499"/>
|
||||
</radialGradient>
|
||||
|
||||
<radialGradient id="Gradient_4" gradientUnits="userSpaceOnUse" cx="0" cy="0" r="26.7375" fx="0" fy="0" gradientTransform="matrix( 1, 0, 0, 1, 0,0.1) " spreadMethod="pad">
|
||||
<stop offset="0%" stop-color="#DEECFF"/>
|
||||
|
||||
<stop offset="100%" stop-color="#219599"/>
|
||||
</radialGradient>
|
||||
|
||||
<radialGradient id="Gradient_5" gradientUnits="userSpaceOnUse" cx="0" cy="0" r="26.7375" fx="0" fy="0" gradientTransform="matrix( 1, 0, 0, 1, 0,0.1) " spreadMethod="pad">
|
||||
<stop offset="0%" stop-color="#FF87CF"/>
|
||||
|
||||
<stop offset="100%" stop-color="#992B2B"/>
|
||||
</radialGradient>
|
||||
|
||||
<g id="Layer11_0_FILL">
|
||||
<path fill="#FFFFFC" fill-opacity="0.5019607843137255" stroke="none" d="
|
||||
M 148.25 47.7
|
||||
Q 148 47.5 147.8 47.25 144.6 44 140 44
|
||||
L 70.75 44
|
||||
Q 71 42.0484375 71 40 71 37.3 70.6 34.8 69.1 25.25 61.9 18.05 59.65 15.8 57.25 14.15 49.7 9 40 9 27.1 9 18.05 18.05 9 27.1 9 40 9 52.85 18.05 61.9 27.1 71 40 71 49.525 71 56.95 66
|
||||
L 140 66
|
||||
Q 144.6 66 147.8 62.8 148 62.6 148.25 62.35 151 59.3 151 55 151 50.8 148.25 47.7
|
||||
M 140 45
|
||||
Q 144.15 45 147.05 47.95 147.4 48.3 147.7 48.65 150 51.35 150 55 150 58.65 147.7 61.4 147.4 61.75 147.05 62.1 144.15 65 140 65
|
||||
L 56.7 65
|
||||
Q 49.4 70 40 70 27.55 70 18.75 61.25 10 52.45 10 40 10 27.55 18.75 18.8 27.55 10 40 10 52.45 10 61.2 18.8 70 27.55 70 40 70 42.6 69.65 45
|
||||
L 140 45
|
||||
M 268.25 47.7
|
||||
Q 268 47.5 267.8 47.25 264.6 44 260 44
|
||||
L 186.6 44
|
||||
Q 186.455078125 43.855078125 186.3 43.7 181.7 39 175 39 168.4 39 163.7 43.7 159 48.4 159 55 159 61.7 163.7 66.3 168.4 71 175 71 181.7 71 186.3 66.3 186.475 66.15 186.65 66
|
||||
L 260 66
|
||||
Q 264.6 66 267.8 62.8 268 62.6 268.25 62.35 271 59.3 271 55 271 50.8 268.25 47.7
|
||||
M 260 45
|
||||
Q 264.15 45 267.05 47.9 270 50.85 270 55 270 59.15 267.05 62.05 264.15 65 260 65
|
||||
L 186.2 65
|
||||
Q 185.9 65.3 185.6 65.6 181.25 70 175 70 168.8 70 164.4 65.6 160 61.25 160 55 160 48.8 164.4 44.4 168.8 40 175 40 181.25 40 185.6 44.4 185.9 44.7 186.2 45
|
||||
L 260 45
|
||||
M 388.25 47.7
|
||||
Q 388 47.5 387.8 47.25 384.6 44 380 44
|
||||
L 306.6 44
|
||||
Q 306.455078125 43.855078125 306.3 43.7 301.7 39 295 39 288.4 39 283.7 43.7 279 48.4 279 55 279 61.7 283.7 66.3 288.4 71 295 71 301.7 71 306.3 66.3 306.475 66.15 306.65 66
|
||||
L 380 66
|
||||
Q 384.6 66 387.8 62.8 388 62.6 388.25 62.35 391 59.3 391 55 391 50.8 388.25 47.7
|
||||
M 380 45
|
||||
Q 384.15 45 387.05 47.9 390 50.85 390 55 390 59.15 387.05 62.05 384.15 65 380 65
|
||||
L 306.2 65
|
||||
Q 305.9 65.3 305.6 65.6 301.25 70 295 70 288.8 70 284.4 65.6 280 61.25 280 55 280 48.8 284.4 44.4 288.8 40 295 40 301.25 40 305.6 44.4 305.9 44.7 306.2 45
|
||||
L 380 45
|
||||
M 508.25 47.7
|
||||
Q 508 47.5 507.8 47.25 504.6 44 500 44
|
||||
L 426.6 44
|
||||
Q 426.455078125 43.855078125 426.3 43.7 421.7 39 415 39 408.4 39 403.7 43.7 399 48.4 399 55 399 61.7 403.7 66.3 408.4 71 415 71 421.7 71 426.3 66.3 426.475 66.15 426.65 66
|
||||
L 500 66
|
||||
Q 504.6 66 507.8 62.8 508 62.6 508.25 62.35 511 59.3 511 55 511 50.8 508.25 47.7
|
||||
M 500 45
|
||||
Q 504.15 45 507.05 47.9 510 50.85 510 55 510 59.15 507.05 62.05 504.15 65 500 65
|
||||
L 426.2 65
|
||||
Q 425.9 65.3 425.6 65.6 421.25 70 415 70 408.8 70 404.4 65.6 400 61.25 400 55 400 48.8 404.4 44.4 408.8 40 415 40 421.25 40 425.6 44.4 425.9 44.7 426.2 45
|
||||
L 500 45 Z"/>
|
||||
|
||||
<path fill="url(#Gradient_1)" stroke="none" d="
|
||||
M 147.05 47.95
|
||||
Q 144.15 45 140 45
|
||||
L 69.65 45
|
||||
Q 70 42.6 70 40 70 27.55 61.2 18.8 52.45 10 40 10 27.55 10 18.75 18.8 10 27.55 10 40 10 52.45 18.75 61.25 27.55 70 40 70 49.4 70 56.7 65
|
||||
L 140 65
|
||||
Q 144.15 65 147.05 62.1 147.4 61.75 147.7 61.4 150 58.65 150 55 150 51.35 147.7 48.65 147.4 48.3 147.05 47.95
|
||||
M 267.05 47.9
|
||||
Q 264.15 45 260 45
|
||||
L 186.2 45
|
||||
Q 185.9 44.7 185.6 44.4 181.25 40 175 40 168.8 40 164.4 44.4 160 48.8 160 55 160 61.25 164.4 65.6 168.8 70 175 70 181.25 70 185.6 65.6 185.9 65.3 186.2 65
|
||||
L 260 65
|
||||
Q 264.15 65 267.05 62.05 270 59.15 270 55 270 50.85 267.05 47.9
|
||||
M 387.05 47.9
|
||||
Q 384.15 45 380 45
|
||||
L 306.2 45
|
||||
Q 305.9 44.7 305.6 44.4 301.25 40 295 40 288.8 40 284.4 44.4 280 48.8 280 55 280 61.25 284.4 65.6 288.8 70 295 70 301.25 70 305.6 65.6 305.9 65.3 306.2 65
|
||||
L 380 65
|
||||
Q 384.15 65 387.05 62.05 390 59.15 390 55 390 50.85 387.05 47.9
|
||||
M 507.05 47.9
|
||||
Q 504.15 45 500 45
|
||||
L 426.2 45
|
||||
Q 425.9 44.7 425.6 44.4 421.25 40 415 40 408.8 40 404.4 44.4 400 48.8 400 55 400 61.25 404.4 65.6 408.8 70 415 70 421.25 70 425.6 65.6 425.9 65.3 426.2 65
|
||||
L 500 65
|
||||
Q 504.15 65 507.05 62.05 510 59.15 510 55 510 50.85 507.05 47.9 Z"/>
|
||||
</g>
|
||||
|
||||
<g id="Layer8_0_FILL">
|
||||
<path fill="#000000" fill-opacity="0.5019607843137255" stroke="none" d="
|
||||
M 666 51
|
||||
L 666 53.85 662 51 662 53.85 658 51 658 61 662 58.15 662 61 666 58.15 666 61 673 56 666 51
|
||||
M 702 51
|
||||
L 702 53.85 698 51 698 53.85 694 51 694 53.85 690 51 690 61 694 58.15 694 61 698 58.15 698 61 702 58.15 702 61 709 56 702 51
|
||||
M 629 51
|
||||
L 629 53.85 625 51 625 61 629 58 629 61 636 56 629 51
|
||||
M 171.45 48.6
|
||||
Q 170.85 48 170 48 169.2 48 168.6 48.6 168 49.15 168 50 168 50.8 168.6 51.4 169.190625 51.990625 169.95 52 168.790625 52.009375 167.9 52.9 167 53.75 167 55
|
||||
L 167 58 167 64 169 64 169.55 60 170.5 60 171 64 173 64 173 58 173 55
|
||||
Q 173 53.75 172.15 52.9 171.2587890625 52.0087890625 170.2 52 170.859375 51.990625 171.45 51.4 172 50.8 172 50 172 49.15 171.45 48.6
|
||||
M 179.45 48.6
|
||||
Q 178.85 48 178 48 177.2 48 176.6 48.6 176 49.15 176 50 176 50.8 176.6 51.4 177.190625 51.990625 177.95 52 176.790625 52.009375 175.9 52.9 175 53.75 175 55
|
||||
L 175 58 175 64 177 64 177.55 60 178.5 60 179 64 181 64 181 58 181 55
|
||||
Q 181 53.75 180.15 52.9 179.2587890625 52.0087890625 178.2 52 178.859375 51.990625 179.45 51.4 180 50.8 180 50 180 49.15 179.45 48.6
|
||||
M 294.8 48.95
|
||||
L 294.8 47.95 293.4 47.95 293.4 48.95
|
||||
Q 289.05 49.5 289.05 52.95 289.05 54.3 289.9 55.25 290.7 56.2 293.4 56.8
|
||||
L 293.4 60.85
|
||||
Q 291.35 60.7 290.75 58.55
|
||||
L 288.55 59.05
|
||||
Q 289.6 62.45 293.4 62.75
|
||||
L 293.4 63.85 294.8 63.85 294.8 62.75
|
||||
Q 297 62.55 298.15 61.4 299.35 60.3 299.35 58.6 299.35 57.4 298.8 56.5 298.2 55.6 297.5 55.3 296.8 55 294.8 54.4
|
||||
L 294.8 50.85
|
||||
Q 296.2 50.95 296.75 52.55
|
||||
L 298.85 52.1
|
||||
Q 298 49.35 294.8 48.95
|
||||
M 294.8 60.85
|
||||
L 294.8 56.95
|
||||
Q 297.05 57.35 297.05 58.85 297.05 59.75 296.45 60.3 295.75 60.85 294.8 60.85
|
||||
M 293.4 54.3
|
||||
Q 291.35 54 291.35 52.6 291.35 51.7 291.95 51.3 292.55 50.85 293.4 50.85
|
||||
L 293.4 54.3
|
||||
M 416 48.15
|
||||
Q 413.15 47.85 411 48.3 408.85 48.75 408.45 49.85
|
||||
L 408.95 51.35 407.05 52.05
|
||||
Q 405.65 52.7 407 55.9 407.5 56.55 408.45 56.55
|
||||
L 410.6 56.55
|
||||
Q 411.4 58.4 412.6 58.3 414.35 60.4 412.1 61.65
|
||||
L 411.1 63.25
|
||||
Q 410.7 63.8 413.7 63.9 416.6 63.95 416.9 63.55
|
||||
L 415.95 61.65
|
||||
Q 413.7 60.4 415.45 58.3 416.65 58.4 417.45 56.55
|
||||
L 419.6 56.55
|
||||
Q 420.55 56.55 421.05 55.9 422.4 52.7 421 52.05
|
||||
L 419.1 51.35 419.6 49.85
|
||||
Q 418.8 48.4 416 48.15
|
||||
M 417.85 55.5
|
||||
L 418.8 52.4 420 52.65
|
||||
Q 421.4 53.1 420.05 55.3 419.55 55.7 418.6 55.7
|
||||
L 417.75 55.7
|
||||
Q 417.8 55.6 417.85 55.5
|
||||
M 408 55.3
|
||||
Q 406.65 53.1 408.05 52.65
|
||||
L 409.25 52.4 410.2 55.5
|
||||
Q 410.25 55.6 410.3 55.7
|
||||
L 409.45 55.7
|
||||
Q 408.5 55.7 408 55.3
|
||||
M 555 51
|
||||
L 555 61 559 61 559 51 555 51
|
||||
M 561 51
|
||||
L 561 61 565 61 565 51 561 51
|
||||
M 591 51
|
||||
L 591 61 598 56 591 51 Z"/>
|
||||
</g>
|
||||
|
||||
<g id="Symbole_1_0_Layer2_0_FILL">
|
||||
<path fill="url(#Gradient_2)" stroke="none" d="
|
||||
M 17.65 17.75
|
||||
L 0 0.1 -17.65 17.75
|
||||
Q -10.35 25.05 0 25 10.35 25.05 17.65 17.75 Z"/>
|
||||
|
||||
<path fill="url(#Gradient_3)" stroke="none" d="
|
||||
M -25 0
|
||||
Q -25 10.4 -17.65 17.75
|
||||
L 0 0.1 -17.7 -17.6
|
||||
Q -25 -10.3 -25 0 Z"/>
|
||||
|
||||
<path fill="url(#Gradient_4)" stroke="none" d="
|
||||
M 17.7 -17.6
|
||||
Q 10.35 -24.95 0 -25 -10.35 -24.95 -17.7 -17.6
|
||||
L 0 0.1 17.7 -17.6 Z"/>
|
||||
|
||||
<path fill="url(#Gradient_5)" stroke="none" d="
|
||||
M 24.55 -4.85
|
||||
Q 23.2 -12.1 17.7 -17.6
|
||||
L 0 0.1 17.65 17.75
|
||||
Q 19.2 16.2 20.45 14.55 25.05 8.25 25 0 25 -2.5 24.55 -4.85 Z"/>
|
||||
</g>
|
||||
|
||||
<g id="Symbole_1_0_Layer1_0_FILL">
|
||||
<path fill="#FF0E0E" stroke="none" d="
|
||||
M 0 0.1
|
||||
L 4.15 4.25
|
||||
Q 4.1755859375 4.22578125 4.2 4.2 6 2.4 6 0 6 -2.3986328125 4.25 -4.2
|
||||
L 0 0.1 Z"/>
|
||||
|
||||
<path fill="#99FFFF" stroke="none" d="
|
||||
M 0 22.1
|
||||
Q 0.675 22.1 1.25 21.9 -2.9798828125 19.3140625 -1.3 14.3 -2.1380859375 14.5677734375 -2.85 15.25 -4 16.45 -4 18.1 -4 19.7 -2.85 20.9 -1.65 22.1 0 22.1 Z"/>
|
||||
|
||||
<path fill="#103CA5" stroke="none" d="
|
||||
M 1.25 21.9
|
||||
Q 2.1205078125 21.608984375 2.8 20.9 4 19.7 4 18.1 4 16.45 2.8 15.25 1.65 14.1 0 14.1 -0.6712890625 14.1 -1.3 14.3 -2.9798828125 19.3140625 1.25 21.9 Z"/>
|
||||
|
||||
<path fill="#FFFF00" stroke="none" d="
|
||||
M 4 -17.9
|
||||
Q 4 -19.55 2.8 -20.75 1.65 -21.9 0 -21.9 -1.65 -21.9 -2.85 -20.75 -4 -19.55 -4 -17.9 -4 -16.3 -2.85 -15.1 -1.65 -13.9 0 -13.9 1.65 -13.9 2.8 -15.1 4 -16.3 4 -17.9 Z"/>
|
||||
</g>
|
||||
|
||||
<g id="Layer7_0_FILL">
|
||||
<path fill="#DCDCDC" stroke="none" d="
|
||||
M 181 49
|
||||
Q 181 48.15 180.45 47.6 179.85 47 179 47 178.2 47 177.6 47.6 177 48.15 177 49 177 49.8 177.6 50.4 178.190625 50.990625 178.95 51 177.790625 51.009375 176.9 51.9 176 52.75 176 54
|
||||
L 176 57 176 63 178 63 178.55 59 179.5 59 180 63 182 63 182 57 182 54
|
||||
Q 182 52.75 181.15 51.9 180.258984375 51.008984375 179.15 51 179.859375 50.990625 180.45 50.4 181 49.8 181 49
|
||||
M 173 49
|
||||
Q 173 48.15 172.45 47.6 171.85 47 171 47 170.2 47 169.6 47.6 169 48.15 169 49 169 49.8 169.6 50.4 170.190625 50.990625 170.95 51 169.790625 51.009375 168.9 51.9 168 52.75 168 54
|
||||
L 168 57 168 63 170 63 170.55 59 171.5 59 172 63 174 63 174 57 174 54
|
||||
Q 174 52.75 173.15 51.9 172.258984375 51.008984375 171.15 51 171.859375 50.990625 172.45 50.4 173 49.8 173 49
|
||||
M 295.8 47.95
|
||||
L 295.8 46.95 294.4 46.95 294.4 47.95
|
||||
Q 290.05 48.5 290.05 51.95 290.05 53.3 290.9 54.25 291.7 55.2 294.4 55.8
|
||||
L 294.4 59.85
|
||||
Q 292.35 59.7 291.75 57.55
|
||||
L 289.55 58.05
|
||||
Q 290.6 61.45 294.4 61.75
|
||||
L 294.4 62.85 295.8 62.85 295.8 61.75
|
||||
Q 298 61.55 299.15 60.4 300.35 59.3 300.35 57.6 300.35 56.4 299.8 55.5 299.2 54.6 298.5 54.3 297.8 54 295.8 53.4
|
||||
L 295.8 49.85
|
||||
Q 297.2 49.95 297.75 51.55
|
||||
L 299.85 51.1
|
||||
Q 299 48.35 295.8 47.95
|
||||
M 294.4 49.85
|
||||
L 294.4 53.3
|
||||
Q 292.35 53 292.35 51.6 292.35 50.7 292.95 50.3 293.55 49.85 294.4 49.85
|
||||
M 295.8 59.85
|
||||
L 295.8 55.95
|
||||
Q 298.05 56.35 298.05 57.85 298.05 58.75 297.45 59.3 296.75 59.85 295.8 59.85
|
||||
M 420.6 48.85
|
||||
Q 419.80390625 47.384765625 416.95 47.1 414.1470703125 46.861328125 412 47.3 409.8509765625 47.74609375 409.45 48.85
|
||||
L 409.95 50.35 408.05 51.05
|
||||
Q 406.65 51.7 408 54.9 408.5 55.55 409.45 55.55
|
||||
L 411.6 55.55
|
||||
Q 412.4 57.4 413.6 57.3 415.35 59.4 413.1 60.65
|
||||
L 412.1 62.25
|
||||
Q 411.7 62.8 414.7 62.9 417.6 62.95 417.9 62.55
|
||||
L 416.95 60.65
|
||||
Q 414.7 59.4 416.45 57.3 417.65 57.4 418.45 55.55
|
||||
L 420.6 55.55
|
||||
Q 421.55 55.55 422.05 54.9 423.4 51.7 422 51.05
|
||||
L 420.1 50.35 420.6 48.85
|
||||
M 421 51.65
|
||||
Q 422.4 52.1 421.05 54.3 420.55 54.7 419.6 54.7
|
||||
L 418.75 54.7
|
||||
Q 418.8 54.6 418.85 54.5
|
||||
L 419.8 51.4 421 51.65
|
||||
M 411.2 54.5
|
||||
Q 411.25 54.6 411.3 54.7
|
||||
L 410.45 54.7
|
||||
Q 409.5 54.7 409 54.3 407.65 52.1 409.05 51.65
|
||||
L 410.25 51.4 411.2 54.5
|
||||
M 562 50
|
||||
L 562 60 566 60 566 50 562 50
|
||||
M 556 50
|
||||
L 556 60 560 60 560 50 556 50
|
||||
M 626 50
|
||||
L 626 60 633 55 626 50
|
||||
M 637 55
|
||||
L 630 50 630 51.85 634 55 630 58.1 630 60 637 55
|
||||
M 592 50
|
||||
L 592 60 599 55 592 50
|
||||
M 691 50
|
||||
L 691 60 698 55 691 50
|
||||
M 695 50
|
||||
L 695 51.85 699 55 695 58.1 695 60 702 55 695 50
|
||||
M 699 51.85
|
||||
L 703 55 699 58.1 699 60 706 55 699 50 699 51.85
|
||||
M 703 50
|
||||
L 703 51.85 707 55 703 58.1 703 60 710 55 703 50
|
||||
M 659 50
|
||||
L 659 60 666 55 659 50
|
||||
M 663 50
|
||||
L 663 51.85 667 55 663 58.1 663 60 670 55 663 50
|
||||
M 667 50
|
||||
L 667 51.85 671 55 667 58.1 667 60 674 55 667 50 Z"/>
|
||||
</g>
|
||||
|
||||
<path id="Layer8_0_1_STROKES" stroke="#505050" stroke-opacity="0.25098039215686274" stroke-width="1" stroke-linejoin="round" stroke-linecap="round" fill="none" d="
|
||||
M 294.8 60.85
|
||||
Q 295.75 60.85 296.45 60.3 297.05 59.75 297.05 58.85 297.05 57.35 294.8 56.95
|
||||
L 294.8 60.85 Z"/>
|
||||
|
||||
<path id="Layer7_0_1_STROKES" stroke="#505050" stroke-opacity="0.25098039215686274" stroke-width="1" stroke-linejoin="round" stroke-linecap="round" fill="none" d="
|
||||
M 295.8 59.85
|
||||
Q 296.75 59.85 297.45 59.3 298.05 58.75 298.05 57.85 298.05 56.35 295.8 55.95
|
||||
L 295.8 59.85 Z"/>
|
||||
</defs>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Layer11_0_FILL"/>
|
||||
</g>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Layer8_0_FILL"/>
|
||||
|
||||
<use xlink:href="#Layer8_0_1_STROKES"/>
|
||||
</g>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 39,40.9) ">
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Symbole_1_0_Layer2_0_FILL"/>
|
||||
</g>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Symbole_1_0_Layer1_0_FILL"/>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Layer7_0_FILL"/>
|
||||
|
||||
<use xlink:href="#Layer7_0_1_STROKES"/>
|
||||
</g>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 40,39.9) ">
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Symbole_1_0_Layer2_0_FILL"/>
|
||||
</g>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Symbole_1_0_Layer1_0_FILL"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 13 KiB |
BIN
weboasis/arcade/3dcity/img/brush.jpg
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
weboasis/arcade/3dcity/img/building.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
weboasis/arcade/3dcity/img/building.png
Normal file
After Width: | Height: | Size: 1022 KiB |
BIN
weboasis/arcade/3dcity/img/building_n.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
weboasis/arcade/3dcity/img/building_w.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
weboasis/arcade/3dcity/img/env/base.jpg
vendored
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
weboasis/arcade/3dcity/img/env/ceramic.jpg
vendored
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
weboasis/arcade/3dcity/img/env/chrome.jpg
vendored
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
weboasis/arcade/3dcity/img/env/glow.jpg
vendored
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
weboasis/arcade/3dcity/img/env/medium.jpg
vendored
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
weboasis/arcade/3dcity/img/env/plastic.jpg
vendored
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
weboasis/arcade/3dcity/img/env/sky.jpg
vendored
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
weboasis/arcade/3dcity/img/env/smooth.jpg
vendored
Normal file
After Width: | Height: | Size: 18 KiB |
1191
weboasis/arcade/3dcity/img/hud.svg
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
weboasis/arcade/3dcity/img/interface.png
Normal file
After Width: | Height: | Size: 34 KiB |
3597
weboasis/arcade/3dcity/img/interface.svg
Normal file
After Width: | Height: | Size: 124 KiB |
509
weboasis/arcade/3dcity/img/logo.svg
Normal file
@ -0,0 +1,509 @@
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="none" x="0px" y="0px" width="300px" height="300px" viewBox="0 0 300 300">
|
||||
<defs>
|
||||
<linearGradient id="Gradient_1" gradientUnits="userSpaceOnUse" x1="0" y1="1" x2="300" y2="1" spreadMethod="pad">
|
||||
<stop offset="0%" stop-color="#FFFFFF" stop-opacity="0"/>
|
||||
|
||||
<stop offset="50.19607843137255%" stop-color="#FFFFFF"/>
|
||||
|
||||
<stop offset="100%" stop-color="#FFFFFF" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
|
||||
<linearGradient id="Gradient_2" gradientUnits="userSpaceOnUse" x1="0" y1="101" x2="300" y2="101" spreadMethod="pad">
|
||||
<stop offset="0%" stop-color="#FFFFFF" stop-opacity="0"/>
|
||||
|
||||
<stop offset="50.19607843137255%" stop-color="#FFFFFF"/>
|
||||
|
||||
<stop offset="100%" stop-color="#FFFFFF" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
|
||||
<g id="Layer3_0_MEMBER_0_MEMBER_0_MEMBER_0_MEMBER_0_FILL">
|
||||
<path fill="#FFFFFF" fill-opacity="0.30196078431372547" stroke="none" d="
|
||||
M 21.15 239.4
|
||||
Q 30.7 239.4 38.3 240.8 32.1 246.95 29.2 250 25.95 253.45 21.6 259.6 19.35 262.95 18.2 264.85
|
||||
L 18.75 266.25
|
||||
Q 20.4 266.15 22.3 266.2 26.85 266.2 33.3 266.9 41.6 267.8 46.6 268.55 42.55 273.9 36.5 283.6 34.25 287.2 31.35 292.2
|
||||
L 32.1 293.8 37.55 286.05
|
||||
Q 43.15 278 47.2 271.7 50.6 266.35 60.4 257.8 65.25 253.55 69.45 250.4 64.45 248.05 59.05 245.85 47.05 241 40.35 239.75 33.45 238.5 22.4 238.25 16.45 238.15 12.8 238.3
|
||||
L 13.3 239.75
|
||||
Q 16.15 239.5 21.15 239.4
|
||||
M 41.4 241.45
|
||||
Q 50.35 243.5 60.1 247.25 64.8 249.1 67.8 250.55 65.9 251.8 61.2 255.15 54.1 260.35 49.8 264.75
|
||||
L 49.2 265.4 45.15 253.45
|
||||
Q 43.2 247.45 41.4 241.45
|
||||
M 33.9 265.15
|
||||
Q 29.3 264.65 24 264.5
|
||||
L 20 264.45 23.5 259.6
|
||||
Q 27.55 254.2 30.35 251.25
|
||||
L 39.35 241.9 47.55 266.9
|
||||
Q 41.05 265.95 33.9 265.15 Z"/>
|
||||
</g>
|
||||
|
||||
<g id="Layer3_0_MEMBER_1_MEMBER_0_MEMBER_0_MEMBER_0_FILL">
|
||||
<path fill="#FFFFFF" stroke="none" d="
|
||||
M 60.8 245.5
|
||||
Q 52.2 242.05 44.55 240.15 35.1 237.75 22.2 237.6 10.45 237.4 5 238.95
|
||||
L 31.3 295.65 31.6 295.7
|
||||
Q 31.9 295.25 31.95 295.2 33.6 293.45 35.7 290.9 37.2 289 39.1 286.3 40.65 284.2 42.6 280.8
|
||||
L 45.75 275.1
|
||||
Q 48.7 269.45 54.9 263.3 57.95 260.3 60.85 257.95
|
||||
L 70.8 250.85
|
||||
Q 69.15 248.9 60.8 245.5
|
||||
M 52.05 243.6
|
||||
L 52.2 243.35 64.5 248.15 60.6 249.05
|
||||
Q 60.25 249.15 60.05 249
|
||||
L 52.15 243.75 52.05 243.6
|
||||
M 20.3 267.4
|
||||
L 20.45 267.25
|
||||
Q 31.4 271.35 41.7 277.3 40.3 280.35 36.95 285.35 33.65 290.4 31.85 292.1
|
||||
L 20.3 267.4
|
||||
M 52.5 258.1
|
||||
Q 54.7 256 57 254.15
|
||||
L 47.9 267.85 48.3 262.75
|
||||
Q 48.3 262.6 48.45 262.35 50.5 260.1 52.5 258.1
|
||||
M 8 240.5
|
||||
L 10.75 240.7
|
||||
Q 18.15 241.8 24.45 244.85 24.9 245.1 24.95 245.3 25 245.5 24.95 245.95 22.85 254.4 18.35 263
|
||||
L 8 240.5
|
||||
M 17.7 239.75
|
||||
L 14.85 239
|
||||
Q 16.9 238.55 24.9 238.9 33.15 239.2 34.5 239.75 31 240.55 26.95 242.85 26.5 243.1 26.2 242.95
|
||||
L 20.55 240.65
|
||||
Q 19.6 240.25 17.7 239.75
|
||||
M 28.65 247.45
|
||||
L 28.9 247.3 32.25 249.55
|
||||
Q 36.65 252.65 41.25 257.15 43.85 259.9 45.35 261.6 45.75 262 45.75 262.6 45.95 265.45 44.8 269.5
|
||||
L 43.05 274.55 42.7 274.55 28.65 247.45
|
||||
M 36.5 240.85
|
||||
Q 38.25 240.5 39.8 240.55 40.6 240.65 42.25 241.15 48.95 243.1 55.5 247.55
|
||||
L 55.7 247.85
|
||||
Q 43.7 244.25 30.15 243.3
|
||||
L 33.3 241.8
|
||||
Q 35 241.15 36.5 240.85
|
||||
M 25.35 252.05
|
||||
L 26.85 247.8 40.7 274.45
|
||||
Q 30.05 268.4 19.95 264.8
|
||||
L 23.8 256.3
|
||||
Q 24.65 254.25 25.35 252.05
|
||||
M 60.9 252
|
||||
Q 63.2 250.65 64.8 250.45 66.45 250.3 67.85 250.85
|
||||
L 57.3 259 60.9 252
|
||||
M 58.1 250.2
|
||||
Q 55 252 52.15 254.6 49.85 256.55 47.1 259.45
|
||||
L 43.1 255.6
|
||||
Q 41.2 253.8 39.1 251.95
|
||||
L 30.65 245.2
|
||||
Q 45 245.95 58.1 250.2
|
||||
M 73.75 275.45
|
||||
Q 73.55 275.2 73.15 275.2
|
||||
L 70.5 275.2 70.5 273
|
||||
Q 70.5 272.55 70.2 272.3 69.9 272 69.45 272 69.05 272 68.8 272.3 68.5 272.55 68.5 273
|
||||
L 68.5 275.2 67.05 275.2
|
||||
Q 66.7 275.2 66.5 275.45 66.25 275.7 66.25 276.05 66.25 276.35 66.5 276.6 66.7 276.85 67.05 276.85
|
||||
L 68.5 276.85 68.5 283.4
|
||||
Q 68.6 284.7 68.7 285.1 68.9 285.95 69.5 286.45 70.9 287.5 73.15 286.8 73.45 286.75 73.6 286.4 73.75 286.1 73.65 285.75 73.5 285.45 73.2 285.3 72.95 285.15 72.6 285.25 71.8 285.45 71.65 285.4 71.4 285.4 71 285 70.7 284.75 70.6 284.2 70.5 283.8 70.5 283.1
|
||||
L 70.5 276.85 73.15 276.85
|
||||
Q 73.55 276.85 73.75 276.6 74 276.35 74 276.05 74 275.7 73.75 275.45
|
||||
M 124.5 284.5
|
||||
Q 124.05 284.05 123.45 284.05 122.85 284.05 122.4 284.5 121.95 284.95 121.95 285.55 121.95 286.15 122.4 286.6 122.85 287.05 123.45 287.05 124.05 287.05 124.5 286.6 124.95 286.15 124.95 285.55 124.95 284.95 124.5 284.5
|
||||
M 128.9 275.5
|
||||
Q 128.6 275.75 128.6 276.2
|
||||
L 128.6 287 128.5 288.2
|
||||
Q 128.45 288.75 128.2 289.15 128 289.4 127.7 289.5 127.5 289.6 126.95 289.5 126.6 289.4 126.3 289.55 125.95 289.7 125.9 290 125.75 290.35 125.9 290.65 126.05 290.95 126.4 291.1 127.4 291.25 128.1 291.15 128.9 291.1 129.6 290.45 130.25 289.8 130.45 288.9 130.6 287.7 130.6 287
|
||||
L 130.6 276.2
|
||||
Q 130.6 275.75 130.3 275.5 130 275.2 129.6 275.2 129.2 275.2 128.9 275.5
|
||||
M 140.5 276.15
|
||||
Q 140.35 275.85 140 275.75
|
||||
L 139.25 275.4
|
||||
Q 138.45 275.2 137.7 275.2 136.65 275.15 135.65 275.5 134.2 276.1 133.8 277.55 133.4 279.1 134.2 280.1 134.8 280.9 136.4 281.6
|
||||
L 138.2 282.35
|
||||
Q 139.1 282.9 139.1 283.75 139.1 285.35 137.2 285.4 136.2 285.5 135.5 285.25
|
||||
L 134.5 284.8
|
||||
Q 134.15 284.7 133.85 284.85 133.5 285 133.45 285.3 133.3 285.65 133.45 285.95 133.6 286.25 133.95 286.4 135.1 287.05 136.9 287.05 138.6 287.1 139.7 286.3 141.05 285.4 141.05 283.65 141.15 282.05 139.75 281.15 139.1 280.75 137.3 280.05 135.2 279.2 135.65 277.85 135.8 277.25 136.3 277 136.6 276.85 137.15 276.85 138.1 276.85 138.7 277
|
||||
L 139.45 277.3
|
||||
Q 139.75 277.45 140.05 277.3 140.4 277.15 140.5 276.8 140.65 276.5 140.5 276.15
|
||||
M 130.45 271.3
|
||||
Q 130.1 270.95 129.6 270.95 129.1 270.95 128.8 271.3 128.45 271.6 128.45 272.1 128.45 272.6 128.8 272.95 129.1 273.25 129.6 273.25 130.1 273.25 130.45 272.95 130.75 272.6 130.75 272.1 130.75 271.6 130.45 271.3
|
||||
M 118.4 281.5
|
||||
Q 118.8 281.5 118.95 281.3 119.25 280.95 119.15 280.05 119.1 278.05 117.65 276.6 116.25 275.2 114.25 275.2 112.15 275.2 110.7 276.7 109.2 278.35 109.2 281 109.2 284.2 110.7 285.75 111.95 287.05 114.25 287.05 115.4 287.15 116.4 286.9 116.75 286.85 118.1 286.4 118.45 286.35 118.6 286 118.75 285.65 118.6 285.35 118.55 285 118.2 284.85 117.9 284.7 117.55 284.85
|
||||
L 115.6 285.35
|
||||
Q 114.2 285.6 113 285.1 111.95 284.6 111.6 283.65 111.4 282.95 111.3 281.5
|
||||
L 118.4 281.5
|
||||
M 114.25 276.75
|
||||
Q 115.6 276.75 116.4 277.8 117.2 278.75 117.2 280.05
|
||||
L 111.25 280.05
|
||||
Q 111.25 278.75 112.05 277.8 112.9 276.75 114.25 276.75
|
||||
M 82.05 277
|
||||
Q 82.95 277.35 83.3 278.3 83.5 278.95 83.55 280.2
|
||||
L 83.55 286.05
|
||||
Q 83.55 286.55 83.85 286.75 84.15 287.05 84.55 287.05 84.95 287.05 85.25 286.75 85.55 286.55 85.55 286.05
|
||||
L 85.55 279.95
|
||||
Q 85.5 278.1 85.15 277.3 84.6 275.9 83.2 275.45 81.7 274.85 80.35 275.45 79.5 275.8 78.2 276.95
|
||||
L 78.2 270.6
|
||||
Q 78.2 270.2 77.9 269.9 77.7 269.6 77.2 269.6 76.8 269.6 76.5 269.9 76.2 270.2 76.2 270.6
|
||||
L 76.2 286.05
|
||||
Q 76.2 286.55 76.5 286.75 76.8 287.05 77.2 287.05 77.7 287.05 77.9 286.75 78.2 286.55 78.2 286.05
|
||||
L 78.2 278.95
|
||||
Q 79.55 277.6 80 277.3 81.05 276.65 82.05 277
|
||||
M 99.4 283.65
|
||||
Q 99.15 283.05 99.05 281.5
|
||||
L 106.15 281.5
|
||||
Q 106.55 281.5 106.75 281.3 106.95 280.95 106.95 280.05 106.8 278.05 105.45 276.6 104.05 275.2 102 275.2 99.9 275.2 98.45 276.7 96.95 278.35 96.95 281 96.95 284.2 98.45 285.75 99.7 287.05 102 287.05 103.2 287.15 104.15 286.9
|
||||
L 105.9 286.4
|
||||
Q 106.2 286.35 106.35 286 106.5 285.65 106.35 285.35 106.3 285 105.95 284.85 105.65 284.7 105.3 284.85
|
||||
L 103.35 285.35
|
||||
Q 101.95 285.6 100.75 285.1 99.75 284.65 99.4 283.65
|
||||
M 99 280.05
|
||||
Q 99 278.85 99.8 277.8 100.65 276.75 102 276.75 103.3 276.75 104.2 277.8 104.95 278.8 104.95 280.05
|
||||
L 99 280.05
|
||||
M 95.4 276.6
|
||||
Q 95.55 276.15 95.35 275.8 95.2 275.45 94.8 275.3 93.7 275 92.85 275.4 92.5 275.55 91.85 276.1
|
||||
L 91.1 277 91.1 276.2
|
||||
Q 91.1 275.75 90.8 275.5 90.6 275.2 90.1 275.2 89.7 275.2 89.4 275.5 89.1 275.75 89.1 276.2
|
||||
L 89.1 286.05
|
||||
Q 89.1 286.55 89.4 286.75 89.7 287.05 90.1 287.05 90.6 287.05 90.8 286.75 91.1 286.55 91.1 286.05
|
||||
L 91.1 279.4
|
||||
Q 92.05 278.05 92.4 277.7 93.15 276.9 94.1 277.2 94.45 277.3 94.9 277.15 95.25 277 95.4 276.6 Z"/>
|
||||
</g>
|
||||
|
||||
<g id="Layer3_1_MEMBER_0_MEMBER_0_MEMBER_0_MEMBER_0_FILL">
|
||||
<path fill="#FFFFFF" fill-opacity="0.30196078431372547" stroke="none" d="
|
||||
M 185.15 243.3
|
||||
L 183.35 242.05 181.9 241.35
|
||||
Q 184.95 243.2 186.25 245.2
|
||||
L 187.8 245.15
|
||||
Q 188.2 245.15 188.45 245.25
|
||||
L 191.15 245 192.85 245.35 192.7 244.95 189.7 244.95 188.3 244.8
|
||||
Q 187.35 244.65 187 244.45 186.35 244.15 185.15 243.3
|
||||
M 176.6 247.45
|
||||
L 177.15 247 176.8 246.45
|
||||
Q 174.85 248.4 174.4 252.95
|
||||
L 174.55 261.55
|
||||
Q 170.95 260.5 168.35 256.5 165.75 252.6 166.15 248.5
|
||||
L 166.15 248.4
|
||||
Q 164.85 259.1 174.7 262.8 175.3 267.35 177.95 270.6 180.6 274.25 183.95 276 187.35 277.9 191.75 278.1 187.4 283.35 181.55 286.2 177.7 288.1 173.45 288.95
|
||||
L 174.45 288.9
|
||||
Q 182.8 288.25 195.4 278.55 198.2 278.55 201.25 276.9 207.15 279.6 210.1 284.5 213 289.45 217.45 289.5 213.85 288.4 214 286.9 216.2 288.6 219 289.65
|
||||
L 219.05 289.65
|
||||
Q 219.55 289.5 220.45 289.6
|
||||
L 221.75 289.75
|
||||
Q 223.75 290 224.5 290
|
||||
L 224.9 290
|
||||
Q 215.5 287.15 213.15 282.8
|
||||
L 211.35 281.85
|
||||
Q 209.1 280.5 207.6 278.85 206.4 277.65 204.7 276.5
|
||||
L 201.3 274.25
|
||||
Q 202.15 273.6 204.2 271.7 205.9 270.15 207.4 269.6 208.8 269.05 211.05 269.05
|
||||
L 214.9 269.05 214.9 269.55 213.6 270 214.35 270.5
|
||||
Q 219.1 269.55 220.55 266.8 221.5 265.2 221.25 263 228.05 257.6 229.2 248.95
|
||||
L 229.3 248.3 229.1 249
|
||||
Q 228.35 251.8 227.1 253.8 224 258.95 220.35 261.5 218.4 257.1 213.5 253.05 211.3 251.55 209.15 250.85
|
||||
L 209.1 250.85 209.15 250.9
|
||||
Q 209.45 251.35 209.65 251.55
|
||||
L 209.65 251.6
|
||||
Q 212.2 253 213.6 254.1 215.6 255.7 216.7 257.55
|
||||
L 218.1 259.75 218.4 260.1 218.65 260.6
|
||||
Q 219.35 262 219.35 263.7
|
||||
L 219.35 264.95
|
||||
Q 218.95 265.85 218.1 266.45
|
||||
L 218.05 266.45
|
||||
Q 217.45 266.9 216.7 267.05 215 267.35 212.5 266.3
|
||||
L 212.55 265.6 211.6 265.45 211.55 265.95
|
||||
Q 211.55 266.1 210.95 266.25
|
||||
L 209.9 266.45
|
||||
Q 204.9 266.85 202.45 269.15
|
||||
L 201.1 268.25 201.05 268.25 199.95 269.05
|
||||
Q 200.4 269.5 201.25 270.7 198.65 273.1 196.6 274 193.95 275.25 191.1 274.8
|
||||
L 193.25 272.5 192.35 272.3 190.25 274.25 189.65 274.65
|
||||
Q 189.25 274.8 189.05 274.75 186.25 273.8 182.75 272.65 183.7 270.95 185.2 269.15
|
||||
L 184.5 268.6
|
||||
Q 183.3 270 181.9 272
|
||||
L 178.05 267
|
||||
Q 177.65 266.45 177.65 265.85 177.65 265.4 178.15 264.65
|
||||
L 179.75 262.6 179.5 262.05 178.6 263.2
|
||||
Q 178.45 263.35 177.95 264.15
|
||||
L 177.25 265.35
|
||||
Q 176.05 262 175.9 261 175.6 258.8 177.05 257.05
|
||||
L 177.8 256.35 177.7 255.75 176.85 256.55 176.2 257.45
|
||||
Q 176.05 257.65 175.5 258.5 175.25 255.4 175.4 253.2 175.55 250.35 176.2 248.05 176.3 247.7 176.6 247.45
|
||||
M 217.95 280.1
|
||||
Q 218.15 279.95 218.15 279.65 218.15 279.4 217.95 279.25 217.8 279.05 217.5 279.05 217.2 279.05 217 279.25 216.85 279.4 216.85 279.65 216.85 279.95 217 280.1 217.25 280.25 217.5 280.25 217.8 280.25 217.95 280.1 Z"/>
|
||||
</g>
|
||||
|
||||
<g id="Layer3_1_MEMBER_1_MEMBER_0_MEMBER_0_MEMBER_0_FILL">
|
||||
<path fill="#FFFFFF" stroke="none" d="
|
||||
M 207.4 269.6
|
||||
Q 205.9 270.15 204.2 271.7 202.15 273.6 201.3 274.25
|
||||
L 204.7 276.5
|
||||
Q 206.4 277.65 207.6 278.85 209.1 280.5 211.35 281.85
|
||||
L 215.5 283.95
|
||||
Q 217.6 284.95 218.95 284.55 220.15 284.25 221.9 282.25 222.45 281.65 223.5 280.95
|
||||
L 225.35 279.65
|
||||
Q 224.85 276.15 221.4 274.2
|
||||
L 222.75 274.7
|
||||
Q 224.8 275.85 226.75 279.5 228.8 283.3 228.65 285.75 228.6 288.1 227.65 289.1 226.75 290 224.9 290
|
||||
L 224.5 290
|
||||
Q 223.75 290 221.75 289.75
|
||||
L 220.45 289.6
|
||||
Q 219.55 289.5 219.05 289.65
|
||||
L 222.8 290.4
|
||||
Q 225.05 290.85 226.6 291 227.65 291.15 228.55 289.9 229.55 288.7 229.6 287.2 229.9 284.3 228.95 280.95 228.3 278.8 226.7 275.2 226.5 274.8 225.65 274.4
|
||||
L 219.9 272.55
|
||||
Q 216.95 271.7 215.6 271.2 215.25 271.15 214.65 270.7
|
||||
L 213.6 270 214.9 269.55 214.9 269.05 211.05 269.05
|
||||
Q 208.8 269.05 207.4 269.6
|
||||
M 214.85 281.25
|
||||
Q 214.3 280.1 214.75 278.9 215.05 277.8 216.1 277.2 217.2 276.65 218.3 277.15 219.55 277.6 220.4 278.85 221.05 279.65 221.05 280.7 220.95 281.7 220.25 282.5 219.4 283.4 218.55 283.55 217.65 283.7 216.75 282.95 215.4 282.35 214.85 281.25
|
||||
M 213.45 280.15
|
||||
Q 213.5 280.2 213.4 280.65
|
||||
L 213.15 281.15 210.5 279.4
|
||||
Q 210.45 279.3 210.5 279.15
|
||||
L 210.5 278.75
|
||||
Q 211.55 278.4 212.3 278.85 212.9 279.1 213.45 280.15
|
||||
M 210.65 277.35
|
||||
Q 209.95 276.85 210.1 275.1
|
||||
L 213 277.45
|
||||
Q 211.3 277.9 210.65 277.35
|
||||
M 209.05 276.25
|
||||
Q 209.5 276.65 209.65 277.75 208.55 277.9 208.1 277.55 207.65 277.2 207.5 276.05 208.55 275.9 209.05 276.25
|
||||
M 215.2 279.2
|
||||
Q 214.9 280.1 215.4 281.05 215.8 281.85 216.9 282.35 217.95 282.8 218.9 282.45 219.85 282.15 220.15 281.25 220.55 280.35 220 279.45 219.55 278.6 218.5 278.1 217.45 277.7 216.5 278 215.6 278.35 215.2 279.2
|
||||
M 217.5 280.45
|
||||
Q 217 280.45 216.75 280.25 216.45 280.05 216.45 279.65 216.45 279.35 216.75 279.1 217.1 278.85 217.5 278.85 217.9 278.85 218.25 279.1 218.55 279.35 218.55 279.65 218.55 280.05 218.25 280.25 218 280.45 217.5 280.45
|
||||
M 216.25 258.35
|
||||
Q 215.3 257.95 212.95 257.35
|
||||
L 209.55 256.55
|
||||
Q 209.55 259.45 210.7 261.05 211.8 262.5 214.2 262.9
|
||||
L 219.3 264.3
|
||||
Q 219.45 262.15 218.65 260.6 217.85 258.95 216.25 258.35
|
||||
M 200.55 263.05
|
||||
Q 199.4 263.4 199.15 265 198.95 266.5 199.9 267.4
|
||||
L 202.45 269.15
|
||||
Q 204.9 266.85 209.9 266.45
|
||||
L 210.95 266.25
|
||||
Q 211.55 266.1 211.55 265.95 211.85 263.8 211.4 262.95 210.75 261.75 209.85 261.25 208.8 260.65 207.6 260.95 203.25 262.1 200.55 263.05
|
||||
M 198.05 265.45
|
||||
Q 198.15 263.7 197.6 263 196.3 261.4 195.35 261.25 194.3 261.15 192.7 262.35 189.7 264.45 186.9 267.25 184.4 269.8 182.75 272.65 186.25 273.8 189.05 274.75 189.25 274.8 189.65 274.65
|
||||
L 190.25 274.25 197.35 267.75
|
||||
Q 198 267.2 198.05 265.45
|
||||
M 188.75 251.45
|
||||
Q 188.45 250.95 187.75 250.85
|
||||
L 183.8 250.75 177.05 257.05
|
||||
Q 175.6 258.8 175.9 261 176.05 262 177.25 265.35
|
||||
L 177.95 264.15
|
||||
Q 178.45 263.35 178.6 263.2 182.4 258.25 188.1 254.5 188.75 254.1 188.85 253.8 189.15 253.4 189 252.7 188.95 251.8 188.75 251.45
|
||||
M 197.7 246.3
|
||||
L 197.75 246.25 196.3 247.25 203.35 250.2 203.7 251
|
||||
Q 206.35 250.2 209.1 250.85 208.8 250.45 208.6 250.4
|
||||
L 197.7 246.3
|
||||
M 183.35 242.05
|
||||
L 185.15 243.3
|
||||
Q 186.35 244.15 187 244.45 187.35 244.65 188.3 244.8
|
||||
L 189.7 244.95 192.7 244.95
|
||||
Q 191.8 242.45 187.95 241.2 184 239.9 181.9 241.35
|
||||
L 183.35 242.05
|
||||
M 177.15 247
|
||||
L 176.6 247.45
|
||||
Q 176.3 247.7 176.2 248.05 175.55 250.35 175.4 253.2 175.25 255.4 175.5 258.5 176.05 257.65 176.2 257.45
|
||||
L 176.85 256.55 183.45 250.4 184.2 249.4
|
||||
Q 184.2 249.15 183.6 247.85
|
||||
L 186.7 246.2 189.75 245.85 188.8 245.4
|
||||
Q 188.3 245.15 187.8 245.15 183.55 245.25 178.1 245.65 177.85 245.65 177.45 245.95
|
||||
L 176.8 246.45 177.15 247
|
||||
M 229.9 242.1
|
||||
Q 229.45 240.8 229 240.65 228.75 240.55 228.3 240.85
|
||||
L 227.4 241.4
|
||||
Q 228.4 242.9 227.6 243.25 226.25 243.6 225.95 243.9
|
||||
L 227.15 245.5 224.2 246.5 224.8 248.35 221.6 249.1 222.15 251.05 220.15 251.35
|
||||
Q 219.55 251.35 219.15 251.25
|
||||
L 218.2 251.15 218.65 253.4
|
||||
Q 217.75 253.4 217.5 253.45
|
||||
L 216.35 253.35 215 253.05
|
||||
Q 214.3 252.9 213.7 253
|
||||
L 220.35 261.5
|
||||
Q 224 258.95 227.1 253.8 228.35 251.8 229.1 249 229.8 246.55 230.05 243.85 230.15 243.25 229.9 242.1
|
||||
M 156.6 287.15
|
||||
Q 155.4 287.4 154.95 288.65 158.25 290.05 162.25 290.1 165.1 290.2 169.6 289.6 176.45 288.75 181.55 286.2 187.4 283.35 191.75 278.1 187.35 277.9 183.95 276 180.6 274.25 177.95 270.6 177.3 271.5 177.05 272.55 176.9 273.4 176.9 274.7
|
||||
L 176.75 276.6 176 276.3
|
||||
Q 175.6 276.2 175.25 275.95
|
||||
L 174.85 275.55 174.3 274.7 173.55 277.35 173.2 279.65 170.95 278.5 170.2 280.1 169.55 282.3 167.55 280.9 165.95 283.7 164.4 282.55
|
||||
Q 163.3 284.1 162.55 284.55 161.3 285.35 159.95 283.75
|
||||
L 159.75 285.8
|
||||
Q 159.5 286.5 158.6 286.85 158.35 287 157.6 287.1
|
||||
L 156.6 287.15
|
||||
M 216.7 267.05
|
||||
Q 218.45 266.65 219.35 264.95
|
||||
L 212.7 263.25 212.5 266.3
|
||||
Q 215 267.35 216.7 267.05
|
||||
M 216.7 257.55
|
||||
Q 215.6 255.7 213.6 254.1 212.2 253 209.65 251.6
|
||||
L 209.65 251.55
|
||||
Q 205.45 251 204.1 251.95 204.55 252.85 204.95 253.25 205.55 253.85 206.75 254.65
|
||||
L 208.7 255.9
|
||||
Q 209.15 256.25 209.65 256.35
|
||||
L 216.7 257.55
|
||||
M 201.25 270.7
|
||||
Q 199.85 268.65 199 268.4 198.2 268.25 196.35 269.65 194 271.55 191.1 274.8 193.95 275.25 196.6 274 198.65 273.1 201.25 270.7
|
||||
M 195.75 255.95
|
||||
Q 194.85 256.25 194.9 257.85 194.9 259.35 195.8 260.1
|
||||
L 198.55 262.15
|
||||
Q 198.65 262.25 199 262.35
|
||||
L 199.55 262.3 208.8 259.35
|
||||
Q 209.25 256.95 207.3 255.2 205.5 253.7 203.4 253.85 201.8 254 199.6 254.6
|
||||
L 195.75 255.95
|
||||
M 194.65 255.05
|
||||
Q 196.3 255 198.55 253.85 199.4 253.4 200.85 253.15
|
||||
L 203.35 252.75
|
||||
Q 202.7 250.85 201 249.6 199.35 248.4 197.35 248.65 195.95 248.8 194.05 249.4
|
||||
L 190.8 250.55
|
||||
Q 190.45 250.7 190.05 251.3 189.7 252 189.65 252.4 189.65 252.6 190.15 253.05
|
||||
L 191 253.65
|
||||
Q 192.7 255.05 194.65 255.05
|
||||
M 194.1 258.35
|
||||
Q 194.05 256.5 193.3 255.9 191.65 254.4 190.45 254.4 189.35 254.35 187.4 255.65 181.8 259.65 178.15 264.65 177.65 265.4 177.65 265.85 177.65 266.45 178.05 267
|
||||
L 181.9 272
|
||||
Q 186.35 265.45 193.45 260.7 194.2 260.25 194.1 258.35
|
||||
M 190.15 245.95
|
||||
L 186.65 246.45 184.45 248
|
||||
Q 184.45 248.85 184.9 249.3 185.3 249.7 186.25 250.05 187.8 250.55 189.3 250.35 190.55 250.2 192.25 249.25 193 248.8 194.3 248.5
|
||||
L 196.6 248 195.3 246.65 190.15 245.95
|
||||
M 190.1 245.8
|
||||
L 190.7 245.85 195.3 246.6 197.6 246.25 191.15 245 190.1 245.8
|
||||
M 167.5 246.6
|
||||
Q 166.65 246.6 166.35 247.25 166.25 247.45 166.15 248.5 165.75 252.6 168.35 256.5 170.95 260.5 174.55 261.55
|
||||
L 174.4 252.95
|
||||
Q 171.85 252.85 170.2 250.85 169.7 250.3 167.5 246.6
|
||||
M 282.15 279.6
|
||||
Q 282 280.9 282.15 281.95 282.5 283.75 282.9 284.6 283.6 285.95 284.95 286.45 286.55 287 287.8 286.45 288.65 286.05 289.95 284.9
|
||||
L 289.95 285.75
|
||||
Q 289.95 286.15 290.25 286.45 290.5 286.7 290.9 286.7 291.3 286.7 291.65 286.45 291.9 286.1 291.9 285.75
|
||||
L 291.9 270.3
|
||||
Q 291.9 269.9 291.65 269.65 291.35 269.35 290.9 269.35 290.5 269.35 290.25 269.65 289.95 269.9 289.95 270.3
|
||||
L 289.95 276.6
|
||||
Q 288.55 275.45 287.8 275.1 286.45 274.55 284.95 275.1 283.55 275.65 282.9 276.95 282.55 277.7 282.15 279.6
|
||||
M 284.75 277.95
|
||||
Q 285.25 277.05 286.15 276.65 287.15 276.25 288.2 276.95 288.9 277.45 289.95 278.6
|
||||
L 289.95 282.9
|
||||
Q 288.85 284.15 288.2 284.55 287.15 285.25 286.15 284.85 285.3 284.55 284.75 283.6 284.45 282.95 284.15 281.7 284 280.9 284.15 279.85 284.45 278.45 284.75 277.95
|
||||
M 243.25 276.45
|
||||
Q 243.35 276.15 243.25 275.85 243.1 275.6 242.75 275.4
|
||||
L 242 275.1
|
||||
Q 241.2 274.9 240.45 274.9 239.4 274.85 238.45 275.2 236.95 275.8 236.6 277.2 236.25 278.65 236.95 279.75 237.65 280.6 239.2 281.25 240.8 281.85 240.95 282 241.9 282.55 241.9 283.35 241.85 284.95 240 285 239 285.1 238.25 284.85
|
||||
L 237.3 284.4
|
||||
Q 236.95 284.3 236.65 284.45 236.3 284.6 236.25 284.9 236.1 285.25 236.25 285.55 236.4 285.9 236.75 285.95 237.85 286.65 239.7 286.65 241.35 286.65 242.45 285.9 243.75 285 243.8 283.25 243.9 281.65 242.5 280.75
|
||||
L 240.1 279.7
|
||||
Q 238 278.9 238.4 277.5 238.65 276.85 239.1 276.7 239.35 276.55 239.95 276.55 240.85 276.5 241.45 276.7
|
||||
L 242.2 276.95
|
||||
Q 242.5 277.1 242.8 276.95 243.1 276.85 243.25 276.45
|
||||
M 255.55 280.9
|
||||
Q 255.85 280.6 255.75 279.7 255.7 277.7 254.3 276.3 252.85 274.85 250.85 274.85 248.8 274.85 247.35 276.35 245.95 278 245.85 280.65 245.85 283.8 247.35 285.35 248.65 286.65 250.85 286.65 252.05 286.75 253 286.5 253.3 286.45 254.7 286 255.05 285.85 255.2 285.55 255.35 285.25 255.2 284.95 255.15 284.6 254.8 284.45 254.5 284.3 254.15 284.45
|
||||
L 252.25 284.95
|
||||
Q 250.65 285.1 249.65 284.7 248.7 284.25 248.25 283.25 248.05 282.6 247.95 281.15
|
||||
L 255 281.15
|
||||
Q 255.4 281.15 255.55 280.9
|
||||
M 248.7 277.45
|
||||
Q 249.55 276.4 250.85 276.4 252.25 276.4 253.05 277.45 253.8 278.45 253.8 279.7
|
||||
L 247.9 279.7
|
||||
Q 247.9 278.5 248.7 277.45
|
||||
M 259.7 277.4
|
||||
L 261.25 276.75
|
||||
Q 262.3 276.45 263 276.55 263.8 276.6 264.4 277.2 264.8 277.75 264.85 278.55
|
||||
L 264.85 279.85 262.9 279.85
|
||||
Q 261.55 279.95 261.1 280.05 259.9 280.35 258.9 281.15 257.85 282.15 258 283.75 258.15 285.2 259.05 285.85 260.65 287.05 262.55 286.65
|
||||
L 263.9 286.15 264.85 285.4 264.85 285.7
|
||||
Q 264.85 286.2 265.15 286.4 265.45 286.7 265.85 286.7 266.25 286.7 266.55 286.4 266.85 286.2 266.85 285.7
|
||||
L 266.85 278.55
|
||||
Q 266.8 275.6 264.2 275.05 262.65 274.75 261.2 275.05 260.5 275.25 259.1 275.85 258.8 275.9 258.65 276.25 258.5 276.5 258.6 276.9 258.75 277.2 259.05 277.35 259.3 277.5 259.7 277.4
|
||||
M 260.35 284.4
|
||||
Q 259.9 283.7 260.1 282.8 260.5 281.3 262.85 281.3
|
||||
L 264.85 281.3 264.85 283.6 263.75 284.65
|
||||
Q 262.9 285.15 261.95 285.15 260.9 285.15 260.35 284.4
|
||||
M 274.9 270.85
|
||||
Q 273.4 270.75 272.25 271.2
|
||||
L 270.8 271.85
|
||||
Q 270.4 272 270.25 272.4 270.1 272.85 270.2 273.15 270.35 273.55 270.75 273.7 271.2 273.9 271.5 273.75
|
||||
L 273.4 272.85
|
||||
Q 274.55 272.4 275.65 273 276.45 273.4 276.5 274.65 276.65 276 275.9 276.8 275.2 277.5 273.95 277.65 273.25 277.75 272.2 277.75 271.85 277.75 271.6 278 271.35 278.25 271.35 278.55 271.35 278.9 271.6 279.15 271.85 279.4 272.2 279.4
|
||||
L 274.25 279.45
|
||||
Q 275.95 279.7 276.65 280.4 277.5 281.35 277.35 282.6 277.2 283.75 276.5 284.3 275.45 285.05 274.15 284.9 272.95 284.7 271.15 284 270.85 283.9 270.4 284.05 270 284.2 269.85 284.6 269.75 284.9 269.9 285.35 270.05 285.75 270.45 285.9 271.95 286.45 272.9 286.6 274.85 286.9 276.5 286.3 278.15 285.7 279 284.25 279.65 283 279.5 281.8 279.2 280.1 278.1 279.2 277.3 278.7 275.85 278.4 277.25 277.9 277.85 277.35 278.75 276.4 278.75 274.25 278.75 273.05 277.9 272.05 276.75 270.9 274.9 270.85 Z"/>
|
||||
</g>
|
||||
|
||||
<g id="Symbole_1_0_Layer1_0_FILL">
|
||||
<path fill="url(#Gradient_1)" stroke="none" d="
|
||||
M 98.5 -37
|
||||
L 133.5 -37 133.5 0 133.5 2 149 2 149 0 149 -87 199 -87 199 0 199 2 300 2 300 0 201 0 201 -89 147 -89 147 0 135.5 0 135.5 -39 96.5 -39 96.5 0 0 0 0 2 98.5 2 98.5 0 98.5 -37 Z"/>
|
||||
|
||||
<path fill="url(#Gradient_2)" stroke="none" d="
|
||||
M 300 102
|
||||
L 300 100 0 100 0 102 300 102 Z"/>
|
||||
</g>
|
||||
|
||||
<g id="Layer1_0_FILL">
|
||||
<path fill="#FFFFFF" stroke="none" d="
|
||||
M 171.35 211.35
|
||||
Q 170.25 210.7 169.3 210.7 168.05 210.7 166.45 211.75 164.85 212.85 164.05 214.45 163.2 216.05 163.2 217.35 163.2 218.55 163.85 219.3 164.55 220.05 165.65 220.05 168.5 220.05 170.85 218.25 173.15 216.4 173.15 214.6 173.15 213.45 172.8 212.75 172.45 212 171.35 211.35
|
||||
M 170.3 212.45
|
||||
Q 170.5 212.55 170.8 212.9 171.15 213.25 171.2 213.4 171.3 213.55 171.45 214 171.55 214.5 171.55 214.8 171.55 215.35 170.6 216.3 169.7 217.2 168.45 217.9 167.2 218.6 166.45 218.6 166.1 218.6 165.8 218.45 165.45 218.35 165.35 218.25 165.2 218.15 165.1 217.8 165 217.45 165 217.05 165 216 165.55 215.1 166.1 214.15 166.85 213.45 167.55 212.75 168 212.5 168.5 212.25 169.2 212.25 169.25 212.25 169.5 212.4 169.75 212.55 169.8 212.55 170.15 212.55 170.3 212.45
|
||||
M 183.05 217.75
|
||||
Q 183.05 217.6 182.8 217.1 181.9 217.1 181.1 217.3 179.7 217.7 179.3 217.75 179.3 216.5 179.5 215.25 179.65 214 180.1 211.9 180.3 211.7 180.3 211.45 180.3 211.2 180.1 210.85 179.95 210.45 179.55 210.45 179.3 210.45 178.35 211.05
|
||||
L 177.35 211.65
|
||||
Q 176.4 212.2 175.75 212.45 175.25 212.65 175.05 212.8 174.85 212.95 174.85 213.25 174.85 213.75 175.45 213.75 176.3 213.75 177.3 213.15 178.4 212.55 178.45 212.5 177.8 216.15 177.75 217.3 177.7 217.65 177.7 218.05 177.35 218.15 176.25 218.4 175.2 218.55 174.8 218.8 174.4 219 174.4 219.35 174.4 219.55 174.65 219.8 174.9 220.05 175.3 220.05 175.7 220.05 176.5 219.8 176.6 219.8 176.8 219.7 177.75 219.4 177.9 219.4
|
||||
L 177.95 219.45
|
||||
Q 178.15 219.8 178.4 219.8 179.6 219.8 179.55 219.25
|
||||
L 179.5 219
|
||||
Q 179.9 218.85 180.95 218.7 181.95 218.55 182.4 218.4 182.8 218.25 182.95 218.15 183.05 218 183.05 217.75
|
||||
M 189.9 212.2
|
||||
Q 190.55 212.1 190.55 211.45 190.55 211.2 190.3 210.95 190 210.75 189.65 210.75 189.25 210.75 188.75 210.95 188.3 211.2 187.25 212.2 186.25 213.2 185.65 214.1 185.05 214.95 184.8 215.7 184.55 216.45 184.55 217.4 184.55 218.1 185.35 219 186.2 219.9 187.7 219.9 189.05 219.9 189.65 219.7 190.25 219.5 191.2 218.85 192.2 218.25 192.6 217.7 193 217.1 193 216.6 193 215.8 192.3 215.25 191.6 214.65 190.75 214.65 189.45 214.65 188.75 214.9 188.05 215.15 187.6 215.65 187.15 216.1 186.9 216.65 186.65 217.15 186.6 218.05 186.55 218 186.5 217.95 186.15 217.7 186.15 217.1 186.15 216.55 186.35 215.8 186.6 215.1 187.1 214.5 187.6 213.9 188 213.4 188.4 212.95 188.9 212.6 189.45 212.25 189.9 212.2
|
||||
M 190.1 216
|
||||
Q 191.2 216 191.55 216.5 191.5 217 190.45 217.75 189.4 218.5 188.55 218.5 188.35 218.5 187.9 218.45 188.1 216 190.1 216
|
||||
M 115.35 210.15
|
||||
Q 115.1 209.95 114.8 209.95 114.4 209.95 114.15 210.1 113.9 210.3 113.85 210.55 113.8 210.8 113.7 211.6
|
||||
L 113.1 217.25
|
||||
Q 113 218.05 112.85 218.7 112.7 219.2 112.7 219.35 112.7 219.65 112.95 219.95 113.2 220.3 113.6 220.3 113.9 220.3 114.65 220.05 116.4 219.5 118.25 219.5 118.45 219.5 118.85 219.55 119.25 219.55 119.4 219.55 119.9 219.55 120.25 219.3 120.6 219 120.6 218.55 120.6 218.25 120.4 218.05 120.2 217.8 119.8 217.8 119.7 217.8 119.5 217.85 118.85 218 117.25 218.1 116.7 218.1 116.15 218.2 115 218.4 114.75 218.4 114.65 218.4 114.65 218.2 114.65 218.05 115 215.3 115.3 212.6 115.5 211.65 115.6 210.95 115.6 210.7 115.6 210.4 115.35 210.15
|
||||
M 129.2 218.7
|
||||
Q 129.2 219.4 129.4 219.55 129.6 219.7 130 219.7 130.25 219.7 130.65 219.4 131.05 219.1 131.15 218.9 131.3 218.7 131.3 218.3 131.3 218.1 131.05 217.9 130.85 217.7 130.4 217.7 129.85 217.7 129.55 217.8 129.25 217.95 129.25 218.15 129.2 218.35 129.2 218.7
|
||||
M 128 215.4
|
||||
Q 128 214.2 127.25 213.35 126.55 212.5 125.4 212.5 123.65 212.5 122.45 214.2 121.25 215.9 121.25 217.65 121.25 218.75 121.9 219.5 122.55 220.25 123.6 220.25 124.85 220.25 126.15 219.15 127.4 218.05 127.9 216.45 128 215.95 128 215.4
|
||||
M 124.35 214.25
|
||||
Q 124.75 213.95 125.25 213.95 125.8 213.95 126.1 214.4 126.35 214.85 126.35 215.55 126.35 216.8 125.45 217.8 124.55 218.8 123.7 218.8 123.35 218.8 123.15 218.45 122.95 218.05 122.95 217.5 122.95 216.55 123.4 215.65 123.85 214.7 124.35 214.25
|
||||
M 136.4 210.25
|
||||
Q 136.2 210 135.8 210 135.15 210 134.95 210.85 134.6 212.2 134.35 213
|
||||
L 132.85 213.05
|
||||
Q 132.2 213.05 132.2 213.65 132.2 214.1 132.55 214.3 132.85 214.5 133.2 214.5
|
||||
L 133.3 214.5
|
||||
Q 133.5 214.5 133.95 214.45 133.25 217.2 133.25 218.15 133.25 219.15 133.7 219.65 134.2 220.2 135.1 220.2 136.15 220.2 137.15 219.45 138.1 218.7 138.1 218.05 138.1 217.9 138 217.8 137.85 217.7 137.7 217.7 137.45 217.7 137.05 218 136.5 218.45 136.15 218.6 135.8 218.7 135.4 218.7 135.15 218.7 135 218.5 134.9 218.3 134.9 217.7 134.9 217.4 135.25 215.85 135.55 214.35 135.6 214.35
|
||||
L 137.95 213.95
|
||||
Q 139 213.8 139 213.2 139 212.9 138.9 212.8 138.75 212.65 138.4 212.65 138.2 212.65 136 212.85 136.6 210.85 136.6 210.75 136.6 210.45 136.4 210.25
|
||||
M 161.4 213.1
|
||||
Q 161.4 212.25 160.55 211.45 159.7 210.6 158.8 210.6 157.75 210.6 157.15 210.9 156.5 211.2 155.35 212 155.1 212.15 154.95 212.3 154.4 212.65 154.4 212.9 154.4 213.2 154.6 213.5 154.85 213.85 155.1 213.85 155.75 213.85 156.05 213.5 156.55 212.95 157.3 212.5 158 212.1 158.3 212.1 158.85 212.1 159.25 212.45 159.65 212.8 159.65 213.3 159.65 213.75 159.1 214.55 158.55 215.35 157.7 216.05 156.8 216.75 155.25 217.65 154.1 218.35 153.7 218.85 153.3 219.35 153.3 219.95 153.3 220.6 154.05 220.6 154.55 220.6 154.9 220.25 155.15 219.95 155.45 219.8 155.7 219.65 156.35 219.55 157 219.4 157.75 219.4 159.35 219.4 160.3 219.7 160.6 219.75 161.3 219.75 161.85 219.75 162.45 219.5 163.05 219.2 163.05 218.65 163.05 218.5 162.8 218.25 162.6 218 162.35 218 162.05 218 161.75 218.15 161.45 218.25 161.25 218.25 161 218.25 160.2 218.2 159.45 218.1 159.15 218.1 157.45 218.1 156.65 218.3 158.7 217.25 160.05 215.75 161.4 214.25 161.4 213.1
|
||||
M 142.25 209.7
|
||||
Q 142.25 209.2 142 208.9 141.7 208.65 141.35 208.65 141.1 208.65 140.8 209 140.45 209.4 140.35 210.4 139.9 214.55 139.2 218.2 139.05 219.2 139.05 219.35 139.05 219.75 139.3 219.95 139.55 220.15 139.95 220.15 140.2 220.15 140.4 219.95 140.55 219.75 140.9 219 141.4 218.05 142.55 216.5 143.65 214.9 144.05 214.9 144.35 214.9 144.5 215.3 144.6 215.7 144.75 217.1 144.8 218.3 145.3 218.95 145.75 219.6 146.35 219.6 146.65 219.6 146.9 219.4 147.15 219.2 147.15 218.95 147.15 218.7 146.95 218.45 146.65 218.1 146.55 217.75 146.4 217.35 146.25 216.85 146.15 216.35 146.1 215.55 145.9 213.9 145.5 213.5 145.15 213.1 144.55 213.1 143.7 213.1 142.9 213.85 142.05 214.6 140.9 216.75 141.05 215.95 141.35 214.65 141.85 212.45 142.05 211.45 142.25 210.45 142.25 209.7 Z"/>
|
||||
</g>
|
||||
</defs>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Layer3_0_MEMBER_0_MEMBER_0_MEMBER_0_MEMBER_0_FILL"/>
|
||||
</g>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Layer3_0_MEMBER_1_MEMBER_0_MEMBER_0_MEMBER_0_FILL"/>
|
||||
</g>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Layer3_1_MEMBER_0_MEMBER_0_MEMBER_0_MEMBER_0_FILL"/>
|
||||
</g>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Layer3_1_MEMBER_1_MEMBER_0_MEMBER_0_MEMBER_0_FILL"/>
|
||||
</g>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,99.5) ">
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Symbole_1_0_Layer1_0_FILL"/>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
||||
<use xlink:href="#Layer1_0_FILL"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 28 KiB |
BIN
weboasis/arcade/3dcity/img/preview01.jpg
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
weboasis/arcade/3dcity/img/preview02.jpg
Normal file
After Width: | Height: | Size: 154 KiB |
BIN
weboasis/arcade/3dcity/img/preview03.jpg
Normal file
After Width: | Height: | Size: 96 KiB |
BIN
weboasis/arcade/3dcity/img/smoke.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
weboasis/arcade/3dcity/img/smokeparticle.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
weboasis/arcade/3dcity/img/sprites.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
weboasis/arcade/3dcity/img/tiles32.png
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
weboasis/arcade/3dcity/img/tiles32_n.png
Normal file
After Width: | Height: | Size: 114 KiB |
BIN
weboasis/arcade/3dcity/img/tiles32_w.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
weboasis/arcade/3dcity/img/town.jpg
Normal file
After Width: | Height: | Size: 287 KiB |
BIN
weboasis/arcade/3dcity/img/town.png
Normal file
After Width: | Height: | Size: 914 KiB |
BIN
weboasis/arcade/3dcity/img/town_n.png
Normal file
After Width: | Height: | Size: 284 KiB |
BIN
weboasis/arcade/3dcity/img/town_w.jpg
Normal file
After Width: | Height: | Size: 289 KiB |
BIN
weboasis/arcade/3dcity/img/w_building.png
Normal file
After Width: | Height: | Size: 43 KiB |
11536
weboasis/arcade/3dcity/img/w_building.svg
Normal file
After Width: | Height: | Size: 293 KiB |
BIN
weboasis/arcade/3dcity/img/w_town.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
weboasis/arcade/3dcity/img/world.sea
Normal file
35
weboasis/arcade/3dcity/index.html
Normal file
@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>WebOas.is - 3D City</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
|
||||
<link rel="icon" href="favicon.ico" />
|
||||
<style>
|
||||
*{ padding:0; margin: 0; -o-user-select:none; -ms-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -moz-user-select: none;}
|
||||
html { width:100%; height:100%; }
|
||||
body { background:#6666E6; font:10px sans-serif; width:100%; height:100%; color:#FFFFFF; overflow: hidden; }
|
||||
#container{ min-width:465px; min-height:465px; width:100%; height:100%; overflow:hidden; text-align:center; }
|
||||
#container canvas{ position:absolute;top:0;left:0;width:100%;height:100% }
|
||||
#debug{ position:absolute; padding:5px; right:0; bottom:0; text-align:right; width:20%; pointer-events:none; display:block; }
|
||||
#hub{ position:absolute; top:0; left:0; height:100%; width:100%; pointer-events:none; display:block; text-align:center;}
|
||||
#miniGlCanvas{ position:absolute; bottom:60px; left:15px; pointer-events:none; }
|
||||
#logo{pointer-events:none; display:none;}
|
||||
a:link {text-decoration: none; color:#FFAA66;}
|
||||
a:visited {text-decoration: none; color:#FFAA66;}
|
||||
a:active {text-decoration: none; color:#FFAA66;}
|
||||
a:hover {text-decoration: underline; color: red;}
|
||||
</style>
|
||||
<script src="js/three.min.js"></script>
|
||||
<script src="js/sea3d.min.js"></script>
|
||||
<script src="build/view.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="container"></div>
|
||||
<div id="debug">v 0.4</div>
|
||||
<canvas id="miniGlCanvas"></canvas>
|
||||
|
||||
<div id="hub"></div>
|
||||
<object id="logo" width="300" height="300" type="image/svg+xml" data="img/logo.svg"></object>
|
||||
</body></html>
|
45
weboasis/arcade/3dcity/js/SPE.min.js
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
/* shader-particle-engine 1.0.5
|
||||
*
|
||||
* (c) 2015 Luke Moody (http://www.github.com/squarefeet)
|
||||
* Originally based on Lee Stemkoski's original work (https://github.com/stemkoski/stemkoski.github.com/blob/master/Three.js/js/ParticleEngine.js).
|
||||
*
|
||||
* shader-particle-engine may be freely distributed under the MIT license (See LICENSE at root of this repository.)
|
||||
*/
|
||||
var SPE={distributions:{BOX:1,SPHERE:2,DISC:3},valueOverLifetimeLength:4};"function"==typeof define&&define.amd?define("spe",SPE):"undefined"!=typeof exports&&"undefined"!=typeof module&&(module.exports=SPE),SPE.TypedArrayHelper=function(a,b,c,d){"use strict";this.componentSize=c||1,this.size=b||1,this.TypedArrayConstructor=a||Float32Array,this.array=new a(b*this.componentSize),this.indexOffset=d||0},SPE.TypedArrayHelper.constructor=SPE.TypedArrayHelper,SPE.TypedArrayHelper.prototype.setSize=function(a,b){"use strict";var c=this.array.length;return b||(a*=this.componentSize),c>a?this.shrink(a):a>c?this.grow(a):void console.info("TypedArray is already of size:",a+".","Will not resize.")},SPE.TypedArrayHelper.prototype.shrink=function(a){"use strict";return this.array=this.array.subarray(0,a),this.size=a,this},SPE.TypedArrayHelper.prototype.grow=function(a){"use strict";var b=this.array,c=new this.TypedArrayConstructor(a);return c.set(b),this.array=c,this.size=a,this},SPE.TypedArrayHelper.prototype.splice=function(a,b){
|
||||
"use strict";a*=this.componentSize,b*=this.componentSize;for(var c=[],d=this.array,e=d.length,f=0;e>f;++f)(a>f||f>=b)&&c.push(d[f]);return this.setFromArray(0,c),this},SPE.TypedArrayHelper.prototype.setFromArray=function(a,b){"use strict";var c=b.length,d=a+c;return d>this.array.length?this.grow(d):d<this.array.length&&this.shrink(d),this.array.set(b,this.indexOffset+a),this},SPE.TypedArrayHelper.prototype.setVec2=function(a,b){"use strict";return this.setVec2Components(a,b.x,b.y)},SPE.TypedArrayHelper.prototype.setVec2Components=function(a,b,c){"use strict";var d=this.array,e=this.indexOffset+a*this.componentSize;return d[e]=b,d[e+1]=c,this},SPE.TypedArrayHelper.prototype.setVec3=function(a,b){"use strict";return this.setVec3Components(a,b.x,b.y,b.z)},SPE.TypedArrayHelper.prototype.setVec3Components=function(a,b,c,d){"use strict";var e=this.array,f=this.indexOffset+a*this.componentSize;return e[f]=b,e[f+1]=c,e[f+2]=d,this},SPE.TypedArrayHelper.prototype.setVec4=function(a,b){"use strict";
|
||||
return this.setVec4Components(a,b.x,b.y,b.z,b.w)},SPE.TypedArrayHelper.prototype.setVec4Components=function(a,b,c,d,e){"use strict";var f=this.array,g=this.indexOffset+a*this.componentSize;return f[g]=b,f[g+1]=c,f[g+2]=d,f[g+3]=e,this},SPE.TypedArrayHelper.prototype.setMat3=function(a,b){"use strict";return this.setFromArray(this.indexOffset+a*this.componentSize,b.elements)},SPE.TypedArrayHelper.prototype.setMat4=function(a,b){"use strict";return this.setFromArray(this.indexOffset+a*this.componentSize,b.elements)},SPE.TypedArrayHelper.prototype.setColor=function(a,b){"use strict";return this.setVec3Components(a,b.r,b.g,b.b)},SPE.TypedArrayHelper.prototype.setNumber=function(a,b){"use strict";return this.array[this.indexOffset+a*this.componentSize]=b,this},SPE.TypedArrayHelper.prototype.getValueAtIndex=function(a){"use strict";return this.array[this.indexOffset+a]},SPE.TypedArrayHelper.prototype.getComponentValueAtIndex=function(a){"use strict";return this.array.subarray(this.indexOffset+a*this.componentSize);
|
||||
},SPE.ShaderAttribute=function(a,b,c){"use strict";var d=SPE.ShaderAttribute.typeSizeMap;this.type="string"==typeof a&&d.hasOwnProperty(a)?a:"f",this.componentSize=d[this.type],this.arrayType=c||Float32Array,this.typedArray=null,this.bufferAttribute=null,this.dynamicBuffer=!!b,this.updateMin=0,this.updateMax=0},SPE.ShaderAttribute.constructor=SPE.ShaderAttribute,SPE.ShaderAttribute.typeSizeMap={f:1,v2:2,v3:3,v4:4,c:3,m3:9,m4:16},SPE.ShaderAttribute.prototype.setUpdateRange=function(a,b){"use strict";this.updateMin=Math.min(a*this.componentSize,this.updateMin*this.componentSize),this.updateMax=Math.max(b*this.componentSize,this.updateMax*this.componentSize)},SPE.ShaderAttribute.prototype.flagUpdate=function(){"use strict";var a=this.bufferAttribute,b=a.updateRange;b.offset=this.updateMin,b.count=Math.min(this.updateMax-this.updateMin+this.componentSize,this.typedArray.array.length),a.needsUpdate=!0},SPE.ShaderAttribute.prototype.resetUpdateRange=function(){"use strict";this.updateMin=0,this.updateMax=0;
|
||||
},SPE.ShaderAttribute.prototype.resetDynamic=function(){"use strict";this.bufferAttribute.dynamic=this.dynamicBuffer},SPE.ShaderAttribute.prototype.splice=function(a,b){"use strict";this.typedArray.splice(a,b),this.forceUpdateAll()},SPE.ShaderAttribute.prototype.forceUpdateAll=function(){"use strict";this.bufferAttribute.array=this.typedArray.array,this.bufferAttribute.updateRange.offset=0,this.bufferAttribute.updateRange.count=-1,this.bufferAttribute.dynamic=!1,this.bufferAttribute.needsUpdate=!0},SPE.ShaderAttribute.prototype._ensureTypedArray=function(a){"use strict";null!==this.typedArray&&this.typedArray.size===a*this.componentSize||(null!==this.typedArray&&this.typedArray.size!==a?this.typedArray.setSize(a):null===this.typedArray&&(this.typedArray=new SPE.TypedArrayHelper(this.arrayType,a,this.componentSize)))},SPE.ShaderAttribute.prototype._createBufferAttribute=function(a){"use strict";return this._ensureTypedArray(a),null!==this.bufferAttribute?(this.bufferAttribute.array=this.typedArray.array,
|
||||
void(this.bufferAttribute.needsUpdate=!0)):(this.bufferAttribute=new THREE.BufferAttribute(this.typedArray.array,this.componentSize),void(this.bufferAttribute.dynamic=this.dynamicBuffer))},SPE.ShaderAttribute.prototype.getLength=function(){"use strict";return null===this.typedArray?0:this.typedArray.array.length},SPE.shaderChunks={defines:["#define PACKED_COLOR_SIZE 256.0","#define PACKED_COLOR_DIVISOR 255.0"].join("\n"),uniforms:["uniform float deltaTime;","uniform float runTime;","uniform sampler2D texture;","uniform vec4 textureAnimation;","uniform float scale;"].join("\n"),attributes:["attribute vec4 acceleration;","attribute vec3 velocity;","attribute vec4 rotation;","attribute vec3 rotationCenter;","attribute vec4 params;","attribute vec4 size;","attribute vec4 angle;","attribute vec4 color;","attribute vec4 opacity;"].join("\n"),varyings:["varying vec4 vColor;","#ifdef SHOULD_ROTATE_TEXTURE"," varying float vAngle;","#endif","#ifdef SHOULD_CALCULATE_SPRITE"," varying vec4 vSpriteSheet;","#endif"].join("\n"),
|
||||
branchAvoidanceFunctions:["float when_gt(float x, float y) {"," return max(sign(x - y), 0.0);","}","float when_lt(float x, float y) {"," return min( max(1.0 - sign(x - y), 0.0), 1.0 );","}","float when_eq( float x, float y ) {"," return 1.0 - abs( sign( x - y ) );","}","float when_ge(float x, float y) {"," return 1.0 - when_lt(x, y);","}","float when_le(float x, float y) {"," return 1.0 - when_gt(x, y);","}","float and(float a, float b) {"," return a * b;","}","float or(float a, float b) {"," return min(a + b, 1.0);","}"].join("\n"),unpackColor:["vec3 unpackColor( in float hex ) {"," vec3 c = vec3( 0.0 );"," float r = mod( (hex / PACKED_COLOR_SIZE / PACKED_COLOR_SIZE), PACKED_COLOR_SIZE );"," float g = mod( (hex / PACKED_COLOR_SIZE), PACKED_COLOR_SIZE );"," float b = mod( hex, PACKED_COLOR_SIZE );"," c.r = r / PACKED_COLOR_DIVISOR;"," c.g = g / PACKED_COLOR_DIVISOR;"," c.b = b / PACKED_COLOR_DIVISOR;"," return c;","}"].join("\n"),unpackRotationAxis:["vec3 unpackRotationAxis( in float hex ) {"," vec3 c = vec3( 0.0 );"," float r = mod( (hex / PACKED_COLOR_SIZE / PACKED_COLOR_SIZE), PACKED_COLOR_SIZE );"," float g = mod( (hex / PACKED_COLOR_SIZE), PACKED_COLOR_SIZE );"," float b = mod( hex, PACKED_COLOR_SIZE );"," c.r = r / PACKED_COLOR_DIVISOR;"," c.g = g / PACKED_COLOR_DIVISOR;"," c.b = b / PACKED_COLOR_DIVISOR;"," c *= vec3( 2.0 );"," c -= vec3( 1.0 );"," return c;","}"].join("\n"),
|
||||
floatOverLifetime:["float getFloatOverLifetime( in float positionInTime, in vec4 attr ) {"," highp float value = 0.0;"," float deltaAge = positionInTime * float( VALUE_OVER_LIFETIME_LENGTH - 1 );"," float fIndex = 0.0;"," float shouldApplyValue = 0.0;"," value += attr[ 0 ] * when_eq( deltaAge, 0.0 );",""," for( int i = 0; i < VALUE_OVER_LIFETIME_LENGTH - 1; ++i ) {"," fIndex = float( i );"," shouldApplyValue = and( when_gt( deltaAge, fIndex ), when_le( deltaAge, fIndex + 1.0 ) );"," value += shouldApplyValue * mix( attr[ i ], attr[ i + 1 ], deltaAge - fIndex );"," }",""," return value;","}"].join("\n"),colorOverLifetime:["vec3 getColorOverLifetime( in float positionInTime, in vec3 color1, in vec3 color2, in vec3 color3, in vec3 color4 ) {"," vec3 value = vec3( 0.0 );"," value.x = getFloatOverLifetime( positionInTime, vec4( color1.x, color2.x, color3.x, color4.x ) );"," value.y = getFloatOverLifetime( positionInTime, vec4( color1.y, color2.y, color3.y, color4.y ) );"," value.z = getFloatOverLifetime( positionInTime, vec4( color1.z, color2.z, color3.z, color4.z ) );"," return value;","}"].join("\n"),
|
||||
paramFetchingFunctions:["float getAlive() {"," return params.x;","}","float getAge() {"," return params.y;","}","float getMaxAge() {"," return params.z;","}","float getWiggle() {"," return params.w;","}"].join("\n"),forceFetchingFunctions:["vec4 getPosition( in float age ) {"," return modelViewMatrix * vec4( position, 1.0 );","}","vec3 getVelocity( in float age ) {"," return velocity * age;","}","vec3 getAcceleration( in float age ) {"," return acceleration.xyz * age;","}"].join("\n"),rotationFunctions:["#ifdef SHOULD_ROTATE_PARTICLES"," mat4 getRotationMatrix( in vec3 axis, in float angle) {"," axis = normalize(axis);"," float s = sin(angle);"," float c = cos(angle);"," float oc = 1.0 - c;",""," return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,"," oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,"," oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,"," 0.0, 0.0, 0.0, 1.0);"," }",""," vec3 getRotation( in vec3 pos, in float positionInTime ) {"," if( rotation.y == 0.0 ) {"," return pos;"," }",""," vec3 axis = unpackRotationAxis( rotation.x );"," vec3 center = rotationCenter;"," vec3 translated;"," mat4 rotationMatrix;"," float angle = 0.0;"," angle += when_eq( rotation.z, 0.0 ) * rotation.y;"," angle += when_gt( rotation.z, 0.0 ) * mix( 0.0, rotation.y, positionInTime );"," translated = rotationCenter - pos;"," rotationMatrix = getRotationMatrix( axis, angle );"," return center - vec3( rotationMatrix * vec4( translated, 0.0 ) );"," }","#endif"].join("\n"),
|
||||
rotateTexture:[" vec2 vUv = vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y );",""," #ifdef SHOULD_ROTATE_TEXTURE"," float x = gl_PointCoord.x - 0.5;"," float y = 1.0 - gl_PointCoord.y - 0.5;"," float c = cos( -vAngle );"," float s = sin( -vAngle );"," vUv = vec2( c * x + s * y + 0.5, c * y - s * x + 0.5 );"," #endif",""," #ifdef SHOULD_CALCULATE_SPRITE"," float framesX = vSpriteSheet.x;"," float framesY = vSpriteSheet.y;"," float columnNorm = vSpriteSheet.z;"," float rowNorm = vSpriteSheet.w;"," vUv.x = gl_PointCoord.x * framesX + columnNorm;"," vUv.y = 1.0 - (gl_PointCoord.y * framesY + rowNorm);"," #endif",""," vec4 rotatedTexture = texture2D( texture, vUv );"].join("\n")},SPE.shaders={vertex:[SPE.shaderChunks.defines,SPE.shaderChunks.uniforms,SPE.shaderChunks.attributes,SPE.shaderChunks.varyings,THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,SPE.shaderChunks.branchAvoidanceFunctions,SPE.shaderChunks.unpackColor,SPE.shaderChunks.unpackRotationAxis,SPE.shaderChunks.floatOverLifetime,SPE.shaderChunks.colorOverLifetime,SPE.shaderChunks.paramFetchingFunctions,SPE.shaderChunks.forceFetchingFunctions,SPE.shaderChunks.rotationFunctions,"void main() {"," highp float age = getAge();"," highp float alive = getAlive();"," highp float maxAge = getMaxAge();"," highp float positionInTime = (age / maxAge);"," highp float isAlive = when_gt( alive, 0.0 );"," #ifdef SHOULD_WIGGLE_PARTICLES"," float wiggleAmount = positionInTime * getWiggle();"," float wiggleSin = isAlive * sin( wiggleAmount );"," float wiggleCos = isAlive * cos( wiggleAmount );"," #endif"," vec3 vel = getVelocity( age );"," vec3 accel = getAcceleration( age );"," vec3 force = vec3( 0.0 );"," vec3 pos = vec3( position );"," float drag = 1.0 - (positionInTime * 0.5) * acceleration.w;"," force += vel;"," force *= drag;"," force += accel * age;"," pos += force;"," #ifdef SHOULD_WIGGLE_PARTICLES"," pos.x += wiggleSin;"," pos.y += wiggleCos;"," pos.z += wiggleSin;"," #endif"," #ifdef SHOULD_ROTATE_PARTICLES"," pos = getRotation( pos, positionInTime );"," #endif"," vec4 mvPos = modelViewMatrix * vec4( pos, 1.0 );"," highp float pointSize = getFloatOverLifetime( positionInTime, size ) * isAlive;"," #ifdef HAS_PERSPECTIVE"," float perspective = scale / length( mvPos.xyz );"," #else"," float perspective = 1.0;"," #endif"," float pointSizePerspective = pointSize * perspective;"," #ifdef COLORIZE"," vec3 c = isAlive * getColorOverLifetime("," positionInTime,"," unpackColor( color.x ),"," unpackColor( color.y ),"," unpackColor( color.z ),"," unpackColor( color.w )"," );"," #else"," vec3 c = vec3(1.0);"," #endif"," float o = isAlive * getFloatOverLifetime( positionInTime, opacity );"," vColor = vec4( c, o );"," #ifdef SHOULD_ROTATE_TEXTURE"," vAngle = isAlive * getFloatOverLifetime( positionInTime, angle );"," #endif"," #ifdef SHOULD_CALCULATE_SPRITE"," float framesX = textureAnimation.x;"," float framesY = textureAnimation.y;"," float loopCount = textureAnimation.w;"," float totalFrames = textureAnimation.z;"," float frameNumber = mod( (positionInTime * loopCount) * totalFrames, totalFrames );"," float column = floor(mod( frameNumber, framesX ));"," float row = floor( (frameNumber - column) / framesX );"," float columnNorm = column / framesX;"," float rowNorm = row / framesY;"," vSpriteSheet.x = 1.0 / framesX;"," vSpriteSheet.y = 1.0 / framesY;"," vSpriteSheet.z = columnNorm;"," vSpriteSheet.w = rowNorm;"," #endif"," gl_PointSize = pointSizePerspective;"," gl_Position = projectionMatrix * mvPos;",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),
|
||||
fragment:[SPE.shaderChunks.uniforms,THREE.ShaderChunk.common,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,SPE.shaderChunks.varyings,SPE.shaderChunks.branchAvoidanceFunctions,"void main() {"," vec3 outgoingLight = vColor.xyz;"," "," #ifdef ALPHATEST"," if ( vColor.w < float(ALPHATEST) ) discard;"," #endif",SPE.shaderChunks.rotateTexture,THREE.ShaderChunk.logdepthbuf_fragment," outgoingLight = vColor.xyz * rotatedTexture.xyz;",THREE.ShaderChunk.fog_fragment," gl_FragColor = vec4( outgoingLight.xyz, rotatedTexture.w * vColor.w );","}"].join("\n")},SPE.utils={types:{BOOLEAN:"boolean",STRING:"string",NUMBER:"number",OBJECT:"object"},ensureTypedArg:function(a,b,c){"use strict";return typeof a===b?a:c},ensureArrayTypedArg:function(a,b,c){"use strict";if(Array.isArray(a)){for(var d=a.length-1;d>=0;--d)if(typeof a[d]!==b)return c;return a}return this.ensureTypedArg(a,b,c)},ensureInstanceOf:function(a,b,c){"use strict";return void 0!==b&&a instanceof b?a:c;
|
||||
},ensureArrayInstanceOf:function(a,b,c){"use strict";if(Array.isArray(a)){for(var d=a.length-1;d>=0;--d)if(void 0!==b&&a[d]instanceof b==!1)return c;return a}return this.ensureInstanceOf(a,b,c)},ensureValueOverLifetimeCompliance:function(a,b,c){"use strict";b=b||3,c=c||3,Array.isArray(a._value)===!1&&(a._value=[a._value]),Array.isArray(a._spread)===!1&&(a._spread=[a._spread]);var d=this.clamp(a._value.length,b,c),e=this.clamp(a._spread.length,b,c),f=Math.max(d,e);a._value.length!==f&&(a._value=this.interpolateArray(a._value,f)),a._spread.length!==f&&(a._spread=this.interpolateArray(a._spread,f))},interpolateArray:function(a,b){"use strict";for(var c=a.length,d=["function"==typeof a[0].clone?a[0].clone():a[0]],e=(c-1)/(b-1),f=1;b-1>f;++f){var g=f*e,h=Math.floor(g),i=Math.ceil(g),j=g-h;d[f]=this.lerpTypeAgnostic(a[h],a[i],j)}return d.push("function"==typeof a[c-1].clone?a[c-1].clone():a[c-1]),d},clamp:function(a,b,c){"use strict";return Math.max(b,Math.min(a,c))},zeroToEpsilon:function(a,b){
|
||||
"use strict";var c=1e-5,d=a;return d=b?Math.random()*c*10:c,0>a&&a>-c&&(d=-d),d},lerpTypeAgnostic:function(a,b,c){"use strict";var d,e=this.types;return typeof a===e.NUMBER&&typeof b===e.NUMBER?a+(b-a)*c:a instanceof THREE.Vector2&&b instanceof THREE.Vector2?(d=a.clone(),d.x=this.lerp(a.x,b.x,c),d.y=this.lerp(a.y,b.y,c),d):a instanceof THREE.Vector3&&b instanceof THREE.Vector3?(d=a.clone(),d.x=this.lerp(a.x,b.x,c),d.y=this.lerp(a.y,b.y,c),d.z=this.lerp(a.z,b.z,c),d):a instanceof THREE.Vector4&&b instanceof THREE.Vector4?(d=a.clone(),d.x=this.lerp(a.x,b.x,c),d.y=this.lerp(a.y,b.y,c),d.z=this.lerp(a.z,b.z,c),d.w=this.lerp(a.w,b.w,c),d):a instanceof THREE.Color&&b instanceof THREE.Color?(d=a.clone(),d.r=this.lerp(a.r,b.r,c),d.g=this.lerp(a.g,b.g,c),d.b=this.lerp(a.b,b.b,c),d):void console.warn("Invalid argument types, or argument types do not match:",a,b)},lerp:function(a,b,c){"use strict";return a+(b-a)*c},roundToNearestMultiple:function(a,b){"use strict";var c=0;return 0===b?a:(c=Math.abs(a)%b,
|
||||
0===c?a:0>a?-(Math.abs(a)-c):a+b-c)},arrayValuesAreEqual:function(a){"use strict";for(var b=0;b<a.length-1;++b)if(a[b]!==a[b+1])return!1;return!0},randomFloat:function(a,b){"use strict";return a+b*(Math.random()-.5)},randomVector3:function(a,b,c,d,e){"use strict";var f=c.x+(Math.random()*d.x-.5*d.x),g=c.y+(Math.random()*d.y-.5*d.y),h=c.z+(Math.random()*d.z-.5*d.z);e&&(f=.5*-e.x+this.roundToNearestMultiple(f,e.x),g=.5*-e.y+this.roundToNearestMultiple(g,e.y),h=.5*-e.z+this.roundToNearestMultiple(h,e.z)),a.typedArray.setVec3Components(b,f,g,h)},randomColor:function(a,b,c,d){"use strict";var e=c.r+Math.random()*d.x,f=c.g+Math.random()*d.y,g=c.b+Math.random()*d.z;e=this.clamp(e,0,1),f=this.clamp(f,0,1),g=this.clamp(g,0,1),a.typedArray.setVec3Components(b,e,f,g)},randomColorAsHex:function(){"use strict";var a=new THREE.Color;return function(b,c,d,e){for(var f=d.length,g=[],h=0;f>h;++h){var i=e[h];a.copy(d[h]),a.r+=Math.random()*i.x-.5*i.x,a.g+=Math.random()*i.y-.5*i.y,a.b+=Math.random()*i.z-.5*i.z,
|
||||
a.r=this.clamp(a.r,0,1),a.g=this.clamp(a.g,0,1),a.b=this.clamp(a.b,0,1),g.push(a.getHex())}b.typedArray.setVec4Components(c,g[0],g[1],g[2],g[3])}}(),randomVector3OnSphere:function(a,b,c,d,e,f,g,h){"use strict";var i=2*Math.random()-1,j=6.2832*Math.random(),k=Math.sqrt(1-i*i),l=this.randomFloat(d,e),m=0,n=0,o=0;g&&(l=Math.round(l/g)*g),m=k*Math.cos(j)*l,n=k*Math.sin(j)*l,o=i*l,m*=f.x,n*=f.y,o*=f.z,m+=c.x,n+=c.y,o+=c.z,a.typedArray.setVec3Components(b,m,n,o)},seededRandom:function(a){var b=1e4*Math.sin(a);return b-(0|b)},randomVector3OnDisc:function(a,b,c,d,e,f,g){"use strict";var h=6.2832*Math.random(),i=Math.abs(this.randomFloat(d,e)),j=0,k=0,l=0;g&&(i=Math.round(i/g)*g),j=Math.cos(h)*i,k=Math.sin(h)*i,j*=f.x,k*=f.y,j+=c.x,k+=c.y,l+=c.z,a.typedArray.setVec3Components(b,j,k,l)},randomDirectionVector3OnSphere:function(){"use strict";var a=new THREE.Vector3;return function(b,c,d,e,f,g,h,i){a.copy(g),a.x-=d,a.y-=e,a.z-=f,a.normalize().multiplyScalar(-this.randomFloat(h,i)),b.typedArray.setVec3Components(c,a.x,a.y,a.z);
|
||||
}}(),randomDirectionVector3OnDisc:function(){"use strict";var a=new THREE.Vector3;return function(b,c,d,e,f,g,h,i){a.copy(g),a.x-=d,a.y-=e,a.z-=f,a.normalize().multiplyScalar(-this.randomFloat(h,i)),b.typedArray.setVec3Components(c,a.x,a.y,0)}}(),getPackedRotationAxis:function(){"use strict";var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Color,d=new THREE.Vector3(1,1,1);return function(e,f){return a.copy(e).normalize(),b.copy(f).normalize(),a.x+=.5*-f.x+Math.random()*f.x,a.y+=.5*-f.y+Math.random()*f.y,a.z+=.5*-f.z+Math.random()*f.z,a.normalize().add(d).multiplyScalar(.5),c.setRGB(a.x,a.y,a.z),c.getHex()}}()},SPE.Group=function(a){"use strict";var b=SPE.utils,c=b.types;a=b.ensureTypedArg(a,c.OBJECT,{}),a.texture=b.ensureTypedArg(a.texture,c.OBJECT,{}),this.uuid=THREE.Math.generateUUID(),this.fixedTimeStep=b.ensureTypedArg(a.fixedTimeStep,c.NUMBER,.016),this.texture=b.ensureInstanceOf(a.texture.value,THREE.Texture,null),this.textureFrames=b.ensureInstanceOf(a.texture.frames,THREE.Vector2,new THREE.Vector2(1,1)),
|
||||
this.textureFrameCount=b.ensureTypedArg(a.texture.frameCount,c.NUMBER,this.textureFrames.x*this.textureFrames.y),this.textureLoop=b.ensureTypedArg(a.texture.loop,c.NUMBER,1),this.textureFrames.max(new THREE.Vector2(1,1)),this.hasPerspective=b.ensureTypedArg(a.hasPerspective,c.BOOLEAN,!0),this.colorize=b.ensureTypedArg(a.colorize,c.BOOLEAN,!0),this.maxParticleCount=b.ensureTypedArg(a.maxParticleCount,c.NUMBER,null),this.blending=b.ensureTypedArg(a.blending,c.NUMBER,THREE.AdditiveBlending),this.transparent=b.ensureTypedArg(a.transparent,c.BOOLEAN,!0),this.alphaTest=parseFloat(b.ensureTypedArg(a.alphaTest,c.NUMBER,0)),this.depthWrite=b.ensureTypedArg(a.depthWrite,c.BOOLEAN,!1),this.depthTest=b.ensureTypedArg(a.depthTest,c.BOOLEAN,!0),this.fog=b.ensureTypedArg(a.fog,c.BOOLEAN,!0),this.scale=b.ensureTypedArg(a.scale,c.NUMBER,300),this.emitters=[],this.emitterIDs=[],this._pool=[],this._poolCreationSettings=null,this._createNewWhenPoolEmpty=0,this._attributesNeedRefresh=!1,this._attributesNeedDynamicReset=!1,
|
||||
this.particleCount=0,this.uniforms={texture:{type:"t",value:this.texture},textureAnimation:{type:"v4",value:new THREE.Vector4(this.textureFrames.x,this.textureFrames.y,this.textureFrameCount,Math.max(Math.abs(this.textureLoop),1))},fogColor:{type:"c",value:null},fogNear:{type:"f",value:10},fogFar:{type:"f",value:200},fogDensity:{type:"f",value:.5},deltaTime:{type:"f",value:0},runTime:{type:"f",value:0},scale:{type:"f",value:this.scale}},this.defines={HAS_PERSPECTIVE:this.hasPerspective,COLORIZE:this.colorize,VALUE_OVER_LIFETIME_LENGTH:SPE.valueOverLifetimeLength,SHOULD_ROTATE_TEXTURE:!1,SHOULD_ROTATE_PARTICLES:!1,SHOULD_WIGGLE_PARTICLES:!1,SHOULD_CALCULATE_SPRITE:this.textureFrames.x>1||this.textureFrames.y>1},this.attributes={position:new SPE.ShaderAttribute("v3",!0),acceleration:new SPE.ShaderAttribute("v4",!0),velocity:new SPE.ShaderAttribute("v3",!0),rotation:new SPE.ShaderAttribute("v4",!0),rotationCenter:new SPE.ShaderAttribute("v3",!0),params:new SPE.ShaderAttribute("v4",!0),size:new SPE.ShaderAttribute("v4",!0),
|
||||
angle:new SPE.ShaderAttribute("v4",!0),color:new SPE.ShaderAttribute("v4",!0),opacity:new SPE.ShaderAttribute("v4",!0)},this.attributeKeys=Object.keys(this.attributes),this.attributeCount=this.attributeKeys.length,this.material=new THREE.ShaderMaterial({uniforms:this.uniforms,vertexShader:SPE.shaders.vertex,fragmentShader:SPE.shaders.fragment,blending:this.blending,transparent:this.transparent,alphaTest:this.alphaTest,depthWrite:this.depthWrite,depthTest:this.depthTest,defines:this.defines,fog:this.fog}),this.geometry=new THREE.BufferGeometry,this.mesh=new THREE.Points(this.geometry,this.material),null===this.maxParticleCount&&console.warn("SPE.Group: No maxParticleCount specified. Adding emitters after rendering will probably cause errors.")},SPE.Group.constructor=SPE.Group,SPE.Group.prototype._updateDefines=function(){"use strict";var a,b=this.emitters,c=b.length-1,d=this.defines;for(c;c>=0;--c)a=b[c],d.SHOULD_CALCULATE_SPRITE||(d.SHOULD_ROTATE_TEXTURE=d.SHOULD_ROTATE_TEXTURE||!!Math.max(Math.max.apply(null,a.angle.value),Math.max.apply(null,a.angle.spread))),
|
||||
d.SHOULD_ROTATE_PARTICLES=d.SHOULD_ROTATE_PARTICLES||!!Math.max(a.rotation.angle,a.rotation.angleSpread),d.SHOULD_WIGGLE_PARTICLES=d.SHOULD_WIGGLE_PARTICLES||!!Math.max(a.wiggle.value,a.wiggle.spread);this.material.needsUpdate=!0},SPE.Group.prototype._applyAttributesToGeometry=function(){"use strict";var a,b,c=this.attributes,d=this.geometry,e=d.attributes;for(var f in c)c.hasOwnProperty(f)&&(a=c[f],b=e[f],b?b.array=a.typedArray.array:d.addAttribute(f,a.bufferAttribute),a.bufferAttribute.needsUpdate=!0);this.geometry.setDrawRange(0,this.particleCount)},SPE.Group.prototype.addEmitter=function(a){"use strict";if(a instanceof SPE.Emitter==!1)return void console.error("`emitter` argument must be instance of SPE.Emitter. Was provided with:",a);if(this.emitterIDs.indexOf(a.uuid)>-1)return void console.error("Emitter already exists in this group. Will not add again.");if(null!==a.group)return void console.error("Emitter already belongs to another group. Will not add to requested group.");var b=this.attributes,c=this.particleCount,d=c+a.particleCount;
|
||||
this.particleCount=d,null!==this.maxParticleCount&&this.particleCount>this.maxParticleCount&&console.warn("SPE.Group: maxParticleCount exceeded. Requesting",this.particleCount,"particles, can support only",this.maxParticleCount),a._calculatePPSValue(a.maxAge._value+a.maxAge._spread),a._setBufferUpdateRanges(this.attributeKeys),a._setAttributeOffset(c),a.group=this,a.attributes=this.attributes;for(var e in b)b.hasOwnProperty(e)&&b[e]._createBufferAttribute(null!==this.maxParticleCount?this.maxParticleCount:this.particleCount);for(var f=c;d>f;++f)a._assignPositionValue(f),a._assignForceValue(f,"velocity"),a._assignForceValue(f,"acceleration"),a._assignAbsLifetimeValue(f,"opacity"),a._assignAbsLifetimeValue(f,"size"),a._assignAngleValue(f),a._assignRotationValue(f),a._assignParamsValue(f),a._assignColorValue(f);return this._applyAttributesToGeometry(),this.emitters.push(a),this.emitterIDs.push(a.uuid),this._updateDefines(a),this.material.needsUpdate=!0,this.geometry.needsUpdate=!0,this._attributesNeedRefresh=!0,
|
||||
this},SPE.Group.prototype.removeEmitter=function(a){"use strict";var b=this.emitterIDs.indexOf(a.uuid);if(a instanceof SPE.Emitter==!1)return void console.error("`emitter` argument must be instance of SPE.Emitter. Was provided with:",a);if(-1===b)return void console.error("Emitter does not exist in this group. Will not remove.");for(var c=a.attributeOffset,d=c+a.particleCount,e=this.attributes.params.typedArray,f=c;d>f;++f)e.array[4*f]=0,e.array[4*f+1]=0;this.emitters.splice(b,1),this.emitterIDs.splice(b,1);for(var g in this.attributes)this.attributes.hasOwnProperty(g)&&this.attributes[g].splice(c,d);this.particleCount-=a.particleCount,a._onRemove(),this._attributesNeedRefresh=!0},SPE.Group.prototype.getFromPool=function(){"use strict";var a=this._pool,b=this._createNewWhenPoolEmpty;return a.length?a.pop():b?new SPE.Emitter(this._poolCreationSettings):null},SPE.Group.prototype.releaseIntoPool=function(a){"use strict";return a instanceof SPE.Emitter==!1?void console.error("Argument is not instanceof SPE.Emitter:",a):(a.reset(),
|
||||
this._pool.unshift(a),this)},SPE.Group.prototype.getPool=function(){"use strict";return this._pool},SPE.Group.prototype.addPool=function(a,b,c){"use strict";var d;this._poolCreationSettings=b,this._createNewWhenPoolEmpty=!!c;for(var e=0;a>e;++e)d=Array.isArray(b)?new SPE.Emitter(b[e]):new SPE.Emitter(b),this.addEmitter(d),this.releaseIntoPool(d);return this},SPE.Group.prototype._triggerSingleEmitter=function(a){"use strict";var b=this.getFromPool(),c=this;return null===b?void console.log("SPE.Group pool ran out."):(a instanceof THREE.Vector3&&(b.position.value.copy(a),b.position.value=b.position.value),b.enable(),setTimeout(function(){b.disable(),c.releaseIntoPool(b)},1e3*Math.max(b.duration,b.maxAge.value+b.maxAge.spread)),this)},SPE.Group.prototype.triggerPoolEmitter=function(a,b){"use strict";if("number"==typeof a&&a>1)for(var c=0;a>c;++c)this._triggerSingleEmitter(b);else this._triggerSingleEmitter(b);return this},SPE.Group.prototype._updateUniforms=function(a){"use strict";this.uniforms.runTime.value+=a,
|
||||
this.uniforms.deltaTime.value=a},SPE.Group.prototype._resetBufferRanges=function(){"use strict";var a=this.attributeKeys,b=this.attributeCount-1,c=this.attributes;for(b;b>=0;--b)c[a[b]].resetUpdateRange()},SPE.Group.prototype._updateBuffers=function(a){"use strict";var b,c,d,e=this.attributeKeys,f=this.attributeCount-1,g=this.attributes,h=a.bufferUpdateRanges;for(f;f>=0;--f)b=e[f],c=h[b],d=g[b],d.setUpdateRange(c.min,c.max),d.flagUpdate()},SPE.Group.prototype.tick=function(a){"use strict";var b,c=this.emitters,d=c.length,e=a||this.fixedTimeStep,f=this.attributeKeys,g=this.attributes;if(this._updateUniforms(e),this._resetBufferRanges(),0!==d||this._attributesNeedRefresh!==!1||this._attributesNeedDynamicReset!==!1){for(var h,b=0;d>b;++b)h=c[b],h.tick(e),this._updateBuffers(h);if(this._attributesNeedDynamicReset===!0){for(b=this.attributeCount-1;b>=0;--b)g[f[b]].resetDynamic();this._attributesNeedDynamicReset=!1}if(this._attributesNeedRefresh===!0){for(b=this.attributeCount-1;b>=0;--b)g[f[b]].forceUpdateAll();
|
||||
this._attributesNeedRefresh=!1,this._attributesNeedDynamicReset=!0}}},SPE.Group.prototype.dispose=function(){"use strict";return this.geometry.dispose(),this.material.dispose(),this},SPE.Emitter=function(a){"use strict";var b=SPE.utils,c=b.types,d=SPE.valueOverLifetimeLength;a=b.ensureTypedArg(a,c.OBJECT,{}),a.position=b.ensureTypedArg(a.position,c.OBJECT,{}),a.velocity=b.ensureTypedArg(a.velocity,c.OBJECT,{}),a.acceleration=b.ensureTypedArg(a.acceleration,c.OBJECT,{}),a.radius=b.ensureTypedArg(a.radius,c.OBJECT,{}),a.drag=b.ensureTypedArg(a.drag,c.OBJECT,{}),a.rotation=b.ensureTypedArg(a.rotation,c.OBJECT,{}),a.color=b.ensureTypedArg(a.color,c.OBJECT,{}),a.opacity=b.ensureTypedArg(a.opacity,c.OBJECT,{}),a.size=b.ensureTypedArg(a.size,c.OBJECT,{}),a.angle=b.ensureTypedArg(a.angle,c.OBJECT,{}),a.wiggle=b.ensureTypedArg(a.wiggle,c.OBJECT,{}),a.maxAge=b.ensureTypedArg(a.maxAge,c.OBJECT,{}),a.onParticleSpawn&&console.warn("onParticleSpawn has been removed. Please set properties directly to alter values at runtime."),
|
||||
this.uuid=THREE.Math.generateUUID(),this.type=b.ensureTypedArg(a.type,c.NUMBER,SPE.distributions.BOX),this.position={_value:b.ensureInstanceOf(a.position.value,THREE.Vector3,new THREE.Vector3),_spread:b.ensureInstanceOf(a.position.spread,THREE.Vector3,new THREE.Vector3),_spreadClamp:b.ensureInstanceOf(a.position.spreadClamp,THREE.Vector3,new THREE.Vector3),_distribution:b.ensureTypedArg(a.position.distribution,c.NUMBER,this.type),_randomise:b.ensureTypedArg(a.position.randomise,c.BOOLEAN,!1),_radius:b.ensureTypedArg(a.position.radius,c.NUMBER,10),_radiusScale:b.ensureInstanceOf(a.position.radiusScale,THREE.Vector3,new THREE.Vector3(1,1,1)),_distributionClamp:b.ensureTypedArg(a.position.distributionClamp,c.NUMBER,0)},this.velocity={_value:b.ensureInstanceOf(a.velocity.value,THREE.Vector3,new THREE.Vector3),_spread:b.ensureInstanceOf(a.velocity.spread,THREE.Vector3,new THREE.Vector3),_distribution:b.ensureTypedArg(a.velocity.distribution,c.NUMBER,this.type),_randomise:b.ensureTypedArg(a.position.randomise,c.BOOLEAN,!1)
|
||||
},this.acceleration={_value:b.ensureInstanceOf(a.acceleration.value,THREE.Vector3,new THREE.Vector3),_spread:b.ensureInstanceOf(a.acceleration.spread,THREE.Vector3,new THREE.Vector3),_distribution:b.ensureTypedArg(a.acceleration.distribution,c.NUMBER,this.type),_randomise:b.ensureTypedArg(a.position.randomise,c.BOOLEAN,!1)},this.drag={_value:b.ensureTypedArg(a.drag.value,c.NUMBER,0),_spread:b.ensureTypedArg(a.drag.spread,c.NUMBER,0),_randomise:b.ensureTypedArg(a.position.randomise,c.BOOLEAN,!1)},this.wiggle={_value:b.ensureTypedArg(a.wiggle.value,c.NUMBER,0),_spread:b.ensureTypedArg(a.wiggle.spread,c.NUMBER,0)},this.rotation={_axis:b.ensureInstanceOf(a.rotation.axis,THREE.Vector3,new THREE.Vector3(0,1,0)),_axisSpread:b.ensureInstanceOf(a.rotation.axisSpread,THREE.Vector3,new THREE.Vector3),_angle:b.ensureTypedArg(a.rotation.angle,c.NUMBER,0),_angleSpread:b.ensureTypedArg(a.rotation.angleSpread,c.NUMBER,0),_static:b.ensureTypedArg(a.rotation["static"],c.BOOLEAN,!1),_center:b.ensureInstanceOf(a.rotation.center,THREE.Vector3,this.position._value.clone()),
|
||||
_randomise:b.ensureTypedArg(a.position.randomise,c.BOOLEAN,!1)},this.maxAge={_value:b.ensureTypedArg(a.maxAge.value,c.NUMBER,2),_spread:b.ensureTypedArg(a.maxAge.spread,c.NUMBER,0)},this.color={_value:b.ensureArrayInstanceOf(a.color.value,THREE.Color,new THREE.Color),_spread:b.ensureArrayInstanceOf(a.color.spread,THREE.Vector3,new THREE.Vector3),_randomise:b.ensureTypedArg(a.position.randomise,c.BOOLEAN,!1)},this.opacity={_value:b.ensureArrayTypedArg(a.opacity.value,c.NUMBER,1),_spread:b.ensureArrayTypedArg(a.opacity.spread,c.NUMBER,0),_randomise:b.ensureTypedArg(a.position.randomise,c.BOOLEAN,!1)},this.size={_value:b.ensureArrayTypedArg(a.size.value,c.NUMBER,1),_spread:b.ensureArrayTypedArg(a.size.spread,c.NUMBER,0),_randomise:b.ensureTypedArg(a.position.randomise,c.BOOLEAN,!1)},this.angle={_value:b.ensureArrayTypedArg(a.angle.value,c.NUMBER,0),_spread:b.ensureArrayTypedArg(a.angle.spread,c.NUMBER,0),_randomise:b.ensureTypedArg(a.position.randomise,c.BOOLEAN,!1)},this.particleCount=b.ensureTypedArg(a.particleCount,c.NUMBER,100),
|
||||
this.duration=b.ensureTypedArg(a.duration,c.NUMBER,null),this.isStatic=b.ensureTypedArg(a.isStatic,c.BOOLEAN,!1),this.activeMultiplier=b.ensureTypedArg(a.activeMultiplier,c.NUMBER,1),this.direction=b.ensureTypedArg(a.direction,c.NUMBER,1),this.alive=b.ensureTypedArg(a.alive,c.BOOLEAN,!0),this.particlesPerSecond=0,this.activationIndex=0,this.attributeOffset=0,this.attributeEnd=0,this.age=0,this.activeParticleCount=0,this.group=null,this.attributes=null,this.paramsArray=null,this.resetFlags={position:b.ensureTypedArg(a.position.randomise,c.BOOLEAN,!1)||b.ensureTypedArg(a.radius.randomise,c.BOOLEAN,!1),velocity:b.ensureTypedArg(a.velocity.randomise,c.BOOLEAN,!1),acceleration:b.ensureTypedArg(a.acceleration.randomise,c.BOOLEAN,!1)||b.ensureTypedArg(a.drag.randomise,c.BOOLEAN,!1),rotation:b.ensureTypedArg(a.rotation.randomise,c.BOOLEAN,!1),rotationCenter:b.ensureTypedArg(a.rotation.randomise,c.BOOLEAN,!1),size:b.ensureTypedArg(a.size.randomise,c.BOOLEAN,!1),color:b.ensureTypedArg(a.color.randomise,c.BOOLEAN,!1),
|
||||
opacity:b.ensureTypedArg(a.opacity.randomise,c.BOOLEAN,!1),angle:b.ensureTypedArg(a.angle.randomise,c.BOOLEAN,!1)},this.updateFlags={},this.updateCounts={},this.updateMap={maxAge:"params",position:"position",velocity:"velocity",acceleration:"acceleration",drag:"acceleration",wiggle:"params",rotation:"rotation",size:"size",color:"color",opacity:"opacity",angle:"angle"};for(var e in this.updateMap)this.updateMap.hasOwnProperty(e)&&(this.updateCounts[this.updateMap[e]]=0,this.updateFlags[this.updateMap[e]]=!1,this._createGetterSetters(this[e],e));this.bufferUpdateRanges={},this.attributeKeys=null,this.attributeCount=0,b.ensureValueOverLifetimeCompliance(this.color,d,d),b.ensureValueOverLifetimeCompliance(this.opacity,d,d),b.ensureValueOverLifetimeCompliance(this.size,d,d),b.ensureValueOverLifetimeCompliance(this.angle,d,d)},SPE.Emitter.constructor=SPE.Emitter,SPE.Emitter.prototype._createGetterSetters=function(a,b){"use strict";var c=this;for(var d in a)if(a.hasOwnProperty(d)){var e=d.replace("_","");
|
||||
Object.defineProperty(a,e,{get:function(a){return function(){return this[a]}}(d),set:function(a){return function(d){var e=c.updateMap[b],f=this[a],g=SPE.valueOverLifetimeLength;"_rotationCenter"===a?(c.updateFlags.rotationCenter=!0,c.updateCounts.rotationCenter=0):"_randomise"===a?c.resetFlags[e]=d:(c.updateFlags[e]=!0,c.updateCounts[e]=0),c.group._updateDefines(),this[a]=d,Array.isArray(f)&&SPE.utils.ensureValueOverLifetimeCompliance(c[b],g,g)}}(d)})}},SPE.Emitter.prototype._setBufferUpdateRanges=function(a){"use strict";this.attributeKeys=a,this.attributeCount=a.length;for(var b=this.attributeCount-1;b>=0;--b)this.bufferUpdateRanges[a[b]]={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY}},SPE.Emitter.prototype._calculatePPSValue=function(a){"use strict";var b=this.particleCount;this.duration?this.particlesPerSecond=b/(a<this.duration?a:this.duration):this.particlesPerSecond=b/a},SPE.Emitter.prototype._setAttributeOffset=function(a){this.attributeOffset=a,this.activationIndex=a,
|
||||
this.activationEnd=a+this.particleCount},SPE.Emitter.prototype._assignValue=function(a,b){"use strict";switch(a){case"position":this._assignPositionValue(b);break;case"velocity":case"acceleration":this._assignForceValue(b,a);break;case"size":case"opacity":this._assignAbsLifetimeValue(b,a);break;case"angle":this._assignAngleValue(b);break;case"params":this._assignParamsValue(b);break;case"rotation":this._assignRotationValue(b);break;case"color":this._assignColorValue(b)}},SPE.Emitter.prototype._assignPositionValue=function(a){"use strict";var b=SPE.distributions,c=SPE.utils,d=this.position,e=this.attributes.position,f=d._value,g=d._spread,h=d._distribution;switch(h){case b.BOX:c.randomVector3(e,a,f,g,d._spreadClamp);break;case b.SPHERE:c.randomVector3OnSphere(e,a,f,d._radius,d._spread.x,d._radiusScale,d._spreadClamp.x,d._distributionClamp||this.particleCount);break;case b.DISC:c.randomVector3OnDisc(e,a,f,d._radius,d._spread.x,d._radiusScale,d._spreadClamp.x)}},SPE.Emitter.prototype._assignForceValue=function(a,b){
|
||||
"use strict";var c,d,e,f,g,h=SPE.distributions,i=SPE.utils,j=this[b],k=j._value,l=j._spread,m=j._distribution;switch(m){case h.BOX:i.randomVector3(this.attributes[b],a,k,l);break;case h.SPHERE:c=this.attributes.position.typedArray.array,g=3*a,d=c[g],e=c[g+1],f=c[g+2],i.randomDirectionVector3OnSphere(this.attributes[b],a,d,e,f,this.position._value,j._value.x,j._spread.x);break;case h.DISC:c=this.attributes.position.typedArray.array,g=3*a,d=c[g],e=c[g+1],f=c[g+2],i.randomDirectionVector3OnDisc(this.attributes[b],a,d,e,f,this.position._value,j._value.x,j._spread.x)}if("acceleration"===b){var n=i.clamp(i.randomFloat(this.drag._value,this.drag._spread),0,1);this.attributes.acceleration.typedArray.array[4*a+3]=n}},SPE.Emitter.prototype._assignAbsLifetimeValue=function(a,b){"use strict";var c,d=this.attributes[b].typedArray,e=this[b],f=SPE.utils;f.arrayValuesAreEqual(e._value)&&f.arrayValuesAreEqual(e._spread)?(c=Math.abs(f.randomFloat(e._value[0],e._spread[0])),d.setVec4Components(a,c,c,c,c)):d.setVec4Components(a,Math.abs(f.randomFloat(e._value[0],e._spread[0])),Math.abs(f.randomFloat(e._value[1],e._spread[1])),Math.abs(f.randomFloat(e._value[2],e._spread[2])),Math.abs(f.randomFloat(e._value[3],e._spread[3])));
|
||||
},SPE.Emitter.prototype._assignAngleValue=function(a){"use strict";var b,c=this.attributes.angle.typedArray,d=this.angle,e=SPE.utils;e.arrayValuesAreEqual(d._value)&&e.arrayValuesAreEqual(d._spread)?(b=e.randomFloat(d._value[0],d._spread[0]),c.setVec4Components(a,b,b,b,b)):c.setVec4Components(a,e.randomFloat(d._value[0],d._spread[0]),e.randomFloat(d._value[1],d._spread[1]),e.randomFloat(d._value[2],d._spread[2]),e.randomFloat(d._value[3],d._spread[3]))},SPE.Emitter.prototype._assignParamsValue=function(a){"use strict";this.attributes.params.typedArray.setVec4Components(a,this.isStatic?1:0,0,Math.abs(SPE.utils.randomFloat(this.maxAge._value,this.maxAge._spread)),SPE.utils.randomFloat(this.wiggle._value,this.wiggle._spread))},SPE.Emitter.prototype._assignRotationValue=function(a){"use strict";this.attributes.rotation.typedArray.setVec3Components(a,SPE.utils.getPackedRotationAxis(this.rotation._axis,this.rotation._axisSpread),SPE.utils.randomFloat(this.rotation._angle,this.rotation._angleSpread),this.rotation._static?0:1),
|
||||
this.attributes.rotationCenter.typedArray.setVec3(a,this.rotation._center)},SPE.Emitter.prototype._assignColorValue=function(a){"use strict";SPE.utils.randomColorAsHex(this.attributes.color,a,this.color._value,this.color._spread)},SPE.Emitter.prototype._resetParticle=function(a){"use strict";for(var b,c,d=this.resetFlags,e=this.updateFlags,f=this.updateCounts,g=this.attributeKeys,h=this.attributeCount-1;h>=0;--h)b=g[h],c=e[b],d[b]!==!0&&c!==!0||(this._assignValue(b,a),this._updateAttributeUpdateRange(b,a),c===!0&&f[b]===this.particleCount?(e[b]=!1,f[b]=0):1==c&&++f[b])},SPE.Emitter.prototype._updateAttributeUpdateRange=function(a,b){"use strict";var c=this.bufferUpdateRanges[a];c.min=Math.min(b,c.min),c.max=Math.max(b,c.max)},SPE.Emitter.prototype._resetBufferRanges=function(){"use strict";var a,b=this.bufferUpdateRanges,c=this.bufferUpdateKeys,d=this.bufferUpdateCount-1;for(d;d>=0;--d)a=c[d],b[a].min=Number.POSITIVE_INFINITY,b[a].max=Number.NEGATIVE_INFINITY},SPE.Emitter.prototype._onRemove=function(){
|
||||
"use strict";this.particlesPerSecond=0,this.attributeOffset=0,this.activationIndex=0,this.activeParticleCount=0,this.group=null,this.attributes=null,this.paramsArray=null,this.age=0},SPE.Emitter.prototype._decrementParticleCount=function(){"use strict";--this.activeParticleCount},SPE.Emitter.prototype._incrementParticleCount=function(){"use strict";++this.activeParticleCount},SPE.Emitter.prototype._checkParticleAges=function(a,b,c,d){"use strict";for(var e,f,g,h,i=b-1;i>=a;--i)e=4*i,h=c[e],0!==h&&(g=c[e+1],f=c[e+2],1===this.direction?(g+=d,g>=f&&(g=0,h=0,this._decrementParticleCount())):(g-=d,0>=g&&(g=f,h=0,this._decrementParticleCount())),c[e]=h,c[e+1]=g,this._updateAttributeUpdateRange("params",i))},SPE.Emitter.prototype._activateParticles=function(a,b,c,d){"use strict";for(var e,f,g=this.direction,h=a;b>h;++h)e=4*h,0!=c[e]&&1!==this.particleCount||(this._incrementParticleCount(),c[e]=1,this._resetParticle(h),f=d*(h-a),c[e+1]=-1===g?c[e+2]-f:f,this._updateAttributeUpdateRange("params",h));
|
||||
},SPE.Emitter.prototype.tick=function(a){"use strict";if(!this.isStatic){null===this.paramsArray&&(this.paramsArray=this.attributes.params.typedArray.array);var b=this.attributeOffset,c=b+this.particleCount,d=this.paramsArray,e=this.particlesPerSecond*this.activeMultiplier*a,f=this.activationIndex;if(this._resetBufferRanges(),this._checkParticleAges(b,c,d,a),this.alive===!1)return void(this.age=0);if(null!==this.duration&&this.age>this.duration)return this.alive=!1,void(this.age=0);var g=1===this.particleCount?f:0|f,h=Math.min(g+e,this.activationEnd),i=h-this.activationIndex|0,j=i>0?a/i:0;this._activateParticles(g,h,d,j),this.activationIndex+=e,this.activationIndex>c&&(this.activationIndex=b),this.age+=a}},SPE.Emitter.prototype.reset=function(a){"use strict";if(this.age=0,this.alive=!1,a===!0){for(var b,c=this.attributeOffset,d=c+this.particleCount,e=this.paramsArray,f=this.attributes.params.bufferAttribute,g=d-1;g>=c;--g)b=4*g,e[b]=0,e[b+1]=0;f.updateRange.offset=0,f.updateRange.count=-1,
|
||||
f.needsUpdate=!0}return this},SPE.Emitter.prototype.enable=function(){"use strict";return this.alive=!0,this},SPE.Emitter.prototype.disable=function(){"use strict";return this.alive=!1,this},SPE.Emitter.prototype.remove=function(){"use strict";return null!==this.group?this.group.removeEmitter(this):console.error("Emitter does not belong to a group, cannot remove."),this};
|
83
weboasis/arcade/3dcity/js/destructor.js
Normal file
@ -0,0 +1,83 @@
|
||||
|
||||
//------------------------------------------------------//
|
||||
// DESTRUCTOR //
|
||||
//------------------------------------------------------//
|
||||
|
||||
'use strict';
|
||||
|
||||
V3D.Destructor = function(){
|
||||
this.emitter = null;
|
||||
this.particleGroup = null;
|
||||
this.atmosphereBurnEmitter = null;
|
||||
|
||||
this.obj = [];
|
||||
this.objInfo = [];
|
||||
|
||||
this.timestep = 1000/60;
|
||||
this.timer;
|
||||
this.time;
|
||||
this.maxDecal;
|
||||
this.posDecal;
|
||||
this.reflectionCube = null;
|
||||
this.smokeTexture = null;
|
||||
this.isDestroy = false;
|
||||
this.isBurn = false;
|
||||
|
||||
|
||||
this.snd_destroy = null;
|
||||
this.snd_destroy2 = null;
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
V3D.Destructor.prototype = {
|
||||
constructor: V3D.Destructor,
|
||||
init:function() {
|
||||
|
||||
// environement
|
||||
var c3 = document.createElement("canvas");
|
||||
var ctx = c3.getContext("2d");
|
||||
c3.width = c3.height = 64;
|
||||
ctx.rect(0, 0, 64, 64);
|
||||
ctx.fillStyle = "#cc7f66";
|
||||
ctx.fill();
|
||||
|
||||
this.reflectionCube = new THREE.Texture([c3,c3,c3,c3,c3,c3]);
|
||||
this.reflectionCube.needsUpdate = true;
|
||||
|
||||
// texture
|
||||
this.smokeTexture = THREE.ImageUtils.loadTexture('./img/smoke.png');
|
||||
|
||||
// sound
|
||||
this.snd_destroy = new Audio("./sound/explosion-low.mp3");
|
||||
this.snd_destroy2 = new Audio("./sound/explosion-high.mp3");
|
||||
},
|
||||
destruct : function(geo, mat, position){
|
||||
var material = mat.clone()
|
||||
material.reflectivity = 0;
|
||||
material.combine = THREE.MixOperation;
|
||||
material.envMap = this.reflectionCube;
|
||||
material.side = THREE.DoubleSide;
|
||||
|
||||
var geometry = geo.clone();
|
||||
geometry.computeBoundingBox();
|
||||
var box = geometry.boundingBox;
|
||||
|
||||
var mesh = new THREE.Mesh(geometry, material);
|
||||
mesh.position.copy(position);
|
||||
|
||||
this.objInfo.push( [Number(box.max.y.toFixed(2)), Number(box.min.y.toFixed(2)), Number((box.max.x + Math.abs(box.min.x)).toFixed(2)), Number((box.max.z + Math.abs(box.min.z)).toFixed(2)), geometry.vertices.length]);
|
||||
this.obj.push(mesh);
|
||||
|
||||
view3d.scene.add(mesh);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
102
weboasis/arcade/3dcity/js/helicopter.js
Normal file
@ -0,0 +1,102 @@
|
||||
V3D.helicopter = function(base){
|
||||
this.base = base;
|
||||
this.mesh = new THREE.Object3D();
|
||||
this.parts = [];
|
||||
|
||||
this.ToRad = Math.PI / 180;
|
||||
this.gaz = 0.6;
|
||||
this.ge = 0;
|
||||
|
||||
//this.hud = document.getElementsByClassName('hud');//
|
||||
this.hud = document.getElementById('hud').contentDocument;
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
V3D.helicopter.prototype = {
|
||||
constructor: V3D.helicopter,
|
||||
init:function() {
|
||||
this.sound = new Audio("./sound/helico/8534.mp3");
|
||||
var mtx = new THREE.Matrix4().makeScale(1, 1, -1);
|
||||
var m = this.base.meshs['elico'];
|
||||
m.material = this.base.townMaterial;
|
||||
m.geometry.applyMatrix( mtx );
|
||||
m.position.set(0,-0.12,0);
|
||||
this.mesh.add( m );
|
||||
this.mesh.position.set(0,1,0);
|
||||
this.parts[0] = m;
|
||||
|
||||
var o;
|
||||
|
||||
for(var i=0;i<m.children.length;i++){
|
||||
o = m.children[i];
|
||||
o.material = this.base.townMaterial;
|
||||
o.geometry.applyMatrix( mtx );
|
||||
if(o.name == 'elico2'){
|
||||
this.parts[1] = o;
|
||||
this.parts[4] = o.children[0];
|
||||
this.parts[5] = o.children[1];
|
||||
this.parts[4].material = this.base.townMaterial;
|
||||
this.parts[5].material = this.base.townMaterial;
|
||||
this.parts[4].geometry.applyMatrix( mtx );
|
||||
this.parts[5].geometry.applyMatrix( mtx );
|
||||
}
|
||||
if(o.name == 'elico4'){
|
||||
o.position.z = -o.position.z; this.parts[2] = o;
|
||||
|
||||
|
||||
}
|
||||
if(o.name == 'elico3'){ o.position.z = -o.position.z; this.parts[3] = o; }
|
||||
}
|
||||
this.base.scene.add( this.mesh );
|
||||
// this.sound.play();
|
||||
// this.sound.loop = true;
|
||||
// move(1);
|
||||
},
|
||||
move:function(dir){
|
||||
switch(dir){
|
||||
case 1:// front
|
||||
this.parts[1].rotation.x = -0.08;
|
||||
break;
|
||||
case 2:
|
||||
this.parts[1].rotation.x = 0.08;
|
||||
break;
|
||||
case 3:// left
|
||||
this.parts[4].rotation.z = -3.44;
|
||||
this.parts[5].rotation.z = -0.3;
|
||||
break;
|
||||
case 4:// right
|
||||
this.parts[4].rotation.z = -2.84;
|
||||
this.parts[5].rotation.z = 0.3;
|
||||
break;
|
||||
}
|
||||
|
||||
this.parts[1].rotation.y += this.gaz;
|
||||
this.parts[2].rotation.x -= this.gaz;
|
||||
|
||||
this.ge++;
|
||||
|
||||
this.rotate("Symbole_2_0_Layer0_0_FILL", this.ge);
|
||||
|
||||
},
|
||||
fly:function() {
|
||||
if(this.parts.length>2){
|
||||
this.move(1);
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
//------------------
|
||||
|
||||
|
||||
rotate : function(name, deg){
|
||||
var div = this.hud.getElementById(name);
|
||||
if(div){
|
||||
div.setAttribute("transform", "rotate(" + (deg) + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
228
weboasis/arcade/3dcity/js/sea3d.min.js
vendored
Normal file
@ -0,0 +1,228 @@
|
||||
'use strict';var SEA3D={VERSION:180150,getVersion:function(){var a=SEA3D.VERSION.toString(),b=a.length;return a.substring(0,b-4)+"."+a.substring(b-4,b-3)+"."+a.substring(b-3,b-2)+"."+parseFloat(a.substring(b-2,b)).toString()}};console.log("SEA3D "+SEA3D.getVersion());SEA3D.Stream=function(a){this.position=0;this.buffer=a||new ArrayBuffer};SEA3D.Stream.NONE=0;SEA3D.Stream.BOOLEAN=1;SEA3D.Stream.BYTE=2;SEA3D.Stream.UBYTE=3;SEA3D.Stream.SHORT=4;SEA3D.Stream.USHORT=5;SEA3D.Stream.INT24=6;
|
||||
SEA3D.Stream.UINT24=7;SEA3D.Stream.INT=8;SEA3D.Stream.UINT=9;SEA3D.Stream.FLOAT=10;SEA3D.Stream.DOUBLE=11;SEA3D.Stream.DECIMAL=12;SEA3D.Stream.VECTOR3D=74;SEA3D.Stream.VECTOR4D=106;SEA3D.Stream.STRING_TINY=128;SEA3D.Stream.STRING_SHORT=129;SEA3D.Stream.STRING_LONG=130;SEA3D.Stream.ASSET=200;SEA3D.Stream.GROUP=255;SEA3D.Stream.BLEND_MODE="normal add subtract multiply dividing mix alpha screen darken overlay colorburn linearburn lighten colordodge lineardodge softlight hardlight pinlight spotlight spotlightblend hardmix average difference exclusion hue saturation color value linearlight grainextract reflect glow darkercolor lightercolor phoenix negation".split(" ");
|
||||
SEA3D.Stream.INTERPOLATION_TABLE="normal linear sine.in sine.out sine.inout cubic.in cubic.out cubic.inout quint.in quint.out quint.inout circ.in circ.out circ.inout back.in back.out back.inout quad.in quad.out quad.inout quart.in quart.out quart.inout expo.in expo.out expo.inout elastic.in elastic.out elastic.inout bounce.in bounce.out bounce.inout".split(" ");SEA3D.Stream.sizeOf=function(a){return 0==a?0:1<=a&&31>=a?1:32<=a&&63>=a?2:64<=a&&95>=a?3:96<=a&&125>=a?4:-1};
|
||||
SEA3D.Stream.prototype={constructor:SEA3D.Stream,set buffer(a){this.buf=a;this.length=a.byteLength;this.data=new DataView(a)},get buffer(){return this.buf},get bytesAvailable(){return this.length-this.position}};SEA3D.Stream.prototype.getByte=function(a){return this.data.getInt8(a)};SEA3D.Stream.prototype.readBytes=function(a){var b=this.buf.slice(this.position,this.position+a);this.position+=a;return b};SEA3D.Stream.prototype.readByte=function(){return this.data.getInt8(this.position++)};
|
||||
SEA3D.Stream.prototype.readUByte=function(){return this.data.getUint8(this.position++)};SEA3D.Stream.prototype.readBool=function(){return 0!=this.data.getInt8(this.position++)};SEA3D.Stream.prototype.readShort=function(){var a=this.data.getInt16(this.position,!0);this.position+=2;return a};SEA3D.Stream.prototype.readUShort=function(){var a=this.data.getUint16(this.position,!0);this.position+=2;return a};
|
||||
SEA3D.Stream.prototype.readUInt24=function(){var a=this.data.getUint32(this.position,!0)&16777215;this.position+=3;return a};SEA3D.Stream.prototype.readUInt24F=function(){return this.readUShort()|this.readUByte()<<16};SEA3D.Stream.prototype.readInt=function(){var a=this.data.getInt32(this.position,!0);this.position+=4;return a};SEA3D.Stream.prototype.readUInt=function(){var a=this.data.getUint32(this.position,!0);this.position+=4;return a};
|
||||
SEA3D.Stream.prototype.readFloat=function(){var a=this.data.getFloat32(this.position,!0);this.position+=4;return a};SEA3D.Stream.prototype.readUInteger=function(){var a=this.readUByte(),b=a&127;0!=(a&128)&&(a=this.readUByte(),b|=(a&127)<<7,0!=(a&128)&&(a=this.readUByte(),b|=(a&127)<<13));return b};SEA3D.Stream.prototype.readVector2=function(){return{x:this.readFloat(),y:this.readFloat()}};SEA3D.Stream.prototype.readVector3=function(){return{x:this.readFloat(),y:this.readFloat(),z:this.readFloat()}};
|
||||
SEA3D.Stream.prototype.readVector4=function(){return{x:this.readFloat(),y:this.readFloat(),z:this.readFloat(),w:this.readFloat()}};
|
||||
SEA3D.Stream.prototype.readMatrix=function(){var a=new Float32Array(16);a[0]=this.readFloat();a[1]=this.readFloat();a[2]=this.readFloat();a[3]=0;a[4]=this.readFloat();a[5]=this.readFloat();a[6]=this.readFloat();a[7]=0;a[8]=this.readFloat();a[9]=this.readFloat();a[10]=this.readFloat();a[11]=0;a[12]=this.readFloat();a[13]=this.readFloat();a[14]=this.readFloat();a[15]=1;return a};SEA3D.Stream.prototype.readUTF8=function(a){a=this.readBytes(a);return String.fromCharCode.apply(void 0,new Uint16Array(new Uint8Array(a)))};
|
||||
SEA3D.Stream.prototype.readExt=function(){return this.readUTF8(4).replace(/\0/g,"")};SEA3D.Stream.prototype.readUTF8Tiny=function(){return this.readUTF8(this.readUByte())};SEA3D.Stream.prototype.readUTF8Short=function(){return this.readUTF8(this.readUShort())};SEA3D.Stream.prototype.readUTF8Long=function(){return this.readUTF8(this.readUInt())};SEA3D.Stream.prototype.readUByteArray=function(a){var b=new Uint8Array(a);SEA3D.Stream.memcpy(b.buffer,0,this.buffer,this.position,a);this.position+=a;return b};
|
||||
SEA3D.Stream.prototype.readUShortArray=function(a){var b=new Uint16Array(a);a*=2;SEA3D.Stream.memcpy(b.buffer,0,this.buffer,this.position,a);this.position+=a;return b};SEA3D.Stream.prototype.readUInt24Array=function(a){for(var b=new Uint32Array(a),c=0;c<a;c++)b[c]=this.readUInt24();return b};SEA3D.Stream.prototype.readUIntArray=function(a){var b=new Uint32Array(a);a*=4;SEA3D.Stream.memcpy(b.buffer,0,this.buffer,this.position,a);this.position+=a;return b};
|
||||
SEA3D.Stream.prototype.readFloatArray=function(a){var b=new Float32Array(a);a*=4;SEA3D.Stream.memcpy(b.buffer,0,this.buffer,this.position,a);this.position+=a;return b};SEA3D.Stream.prototype.readBlendMode=function(){return SEA3D.Stream.BLEND_MODE[this.readUByte()]};SEA3D.Stream.prototype.readInterpolation=function(){return SEA3D.Stream.INTERPOLATION_TABLE[this.readUByte()]};
|
||||
SEA3D.Stream.prototype.readTags=function(a){for(var b=this.readUByte(),c=0;c<b;++c){var d=this.readUShort(),e=this.readUInt(),f=this.position;a(d,this,e);this.position=f+e}};SEA3D.Stream.prototype.readProperties=function(a){var b=this.readUByte(),c={},d={};c.__type=d;for(var e=0;e<b;e++){var f=this.readUTF8Tiny(),h=this.readUByte();d[f]=h;c[f]=h==SEA3D.Stream.GROUP?this.readProperties(a):this.readToken(h,a)}return c};
|
||||
SEA3D.Stream.prototype.readAnimationList=function(a){for(var b=[],c=this.readUByte(),d=0;d<c;){var e=this.readUByte(),f={};f.relative=0!=(e&1);e&2&&(f.timeScale=this.readFloat());f.tag=a.getObject(this.readUInt());b[d++]=f}return b};
|
||||
SEA3D.Stream.prototype.readScriptList=function(a){for(var b=[],c=this.readUByte(),d=0;d<c;){var e=this.readUByte(),f={};f.priority=e&1|e&2;if(e&4){var h=this.readUByte();f.params={};for(var g=0;g<h;g++){var k=this.readUTF8Tiny();f.params[k]=this.readObject(a)}}e&8&&(f.method=this.readUTF8Tiny());f.tag=a.getObject(this.readUInt());b[d++]=f}return b};SEA3D.Stream.prototype.readObject=function(a){return this.readToken(this.readUByte(),a)};
|
||||
SEA3D.Stream.prototype.readToken=function(a,b){switch(a){case SEA3D.Stream.BOOLEAN:return this.readBool();case SEA3D.Stream.UBYTE:return this.readUByte();case SEA3D.Stream.USHORT:return this.readUShort();case SEA3D.Stream.UINT24:return this.readUInt24();case SEA3D.Stream.INT:return this.readInt();case SEA3D.Stream.UINT:return this.readUInt();case SEA3D.Stream.FLOAT:return this.readFloat();case SEA3D.Stream.VECTOR3D:return this.readVector3();case SEA3D.Stream.VECTOR4D:return this.readVector4();case SEA3D.Stream.STRING_TINY:return this.readUTF8Tiny();
|
||||
case SEA3D.Stream.STRING_SHORT:return this.readUTF8Short();case SEA3D.Stream.STRING_LONG:return this.readUTF8Long();case SEA3D.Stream.ASSET:var c=this.readUInt();return 0<c?b.getObject(c-1).tag:null;default:console.error("DataType not found!")}return null};
|
||||
SEA3D.Stream.prototype.readVector=function(a,b,c){var d=SEA3D.Stream.sizeOf(a);b=c*d+b*d;switch(a){case SEA3D.Stream.BOOLEAN:return this.readUByteArray(b);case SEA3D.Stream.UBYTE:return this.readUByteArray(b);case SEA3D.Stream.USHORT:return this.readUShortArray(b);case SEA3D.Stream.UINT24:return this.readUInt24Array(b);case SEA3D.Stream.UINT:return this.readUIntArray(b);case SEA3D.Stream.FLOAT:return this.readFloatArray(b);case SEA3D.Stream.VECTOR3D:return this.readFloatArray(b);case SEA3D.Stream.VECTOR4D:return this.readFloatArray(b)}};
|
||||
SEA3D.Stream.prototype.append=function(a){var b=new ArrayBuffer(this.data.byteLength+a.byteLength);b.set(new ArrayBuffer(this.data),0);b.set(new ArrayBuffer(a),this.data.byteLength);this.data=b};SEA3D.Stream.prototype.concat=function(a,b){return new SEA3D.Stream(this.buffer.slice(a,a+b))};SEA3D.Stream.memcpy=function(a,b,c,d,e){a=new Uint8Array(a,b,e);c=new Uint8Array(c,d,e);a.set(c)};SEA3D.UByteArray=function(){this.ubytes=[];this.length=0};
|
||||
SEA3D.UByteArray.prototype={constructor:SEA3D.UByteArray,add:function(a){this.ubytes.push(a);this.length+=a.byteLength},toBuffer:function(){for(var a=new Uint8Array(this.length),b=0,c=0;b<this.ubytes.length;b++)a.set(this.ubytes[b],c),c+=this.ubytes[b].byteLength;return a.buffer}};SEA3D.Math={DEGREES:180/Math.PI,RADIANS:Math.PI/180};SEA3D.Math.angle=function(a){var b=0>a;a=(b?-a:a)%360;180<a&&(a=-180+(a-180));return b?-a:a};
|
||||
SEA3D.Math.lerpAngle=function(a,b,c){180<Math.abs(a-b)&&(b=a>b?b+360:b-360);return SEA3D.Math.angle(a+(b-a)*c)};SEA3D.Math.lerpColor=function(a,b,c){var d=a>>24&255,e=a>>16&255,f=a>>8&255;a&=255;e+=((b>>16&255)-e)*c;f+=((b>>8&255)-f)*c;a+=((b&255)-a)*c;return d+((b>>24&255)-d)*c<<24|e<<16|f<<8|a};SEA3D.Math.lerp=function(a,b,c){return a+(b-a)*c};SEA3D.Math.lerp1x=function(a,b,c){a[0]+=(b[0]-a[0])*c};SEA3D.Math.lerp3x=function(a,b,c){a[0]+=(b[0]-a[0])*c;a[1]+=(b[1]-a[1])*c;a[2]+=(b[2]-a[2])*c};
|
||||
SEA3D.Math.lerpAng1x=function(a,b,c){a[0]=SEA3D.Math.lerpAngle(a[0],b[0],c)};SEA3D.Math.lerpColor1x=function(a,b,c){a[0]=SEA3D.Math.lerpColor(a[0],b[0],c)};SEA3D.Math.lerpQuat4x=function(a,b,c){var d=a[0],e=a[1],f=a[2],h=a[3],g=b[0],k=b[1],n=b[2];b=b[3];0>d*g+e*k+f*n+h*b&&(g=-g,k=-k,n=-n,b=-b);d+=c*(g-d);e+=c*(k-e);f+=c*(n-f);c=h+c*(b-h);h=1/Math.sqrt(c*c+d*d+e*e+f*f);a[0]=d*h;a[1]=e*h;a[2]=f*h;a[3]=c*h};SEA3D.Timer=function(){this.time=this.start=Date.now()};
|
||||
SEA3D.Timer.prototype={constructor:SEA3D.Timer,get now(){return Date.now()},get deltaTime(){return Date.now()-this.time},get elapsedTime(){return Date.now()-this.start},update:function(){this.time=Date.now()}};SEA3D.Object=function(a,b,c,d){this.name=a;this.data=b;this.type=c;this.sea3d=d};
|
||||
SEA3D.GeometryBase=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.attrib=b.readUShort();this.isBig=0!=(this.attrib&1);b.readVInt=this.isBig?b.readUInt:b.readUShort;this.numVertex=b.readVInt();this.length=3*this.numVertex};
|
||||
SEA3D.Geometry=function(a,b,c){SEA3D.GeometryBase.call(this,a,b,c);var d;this.attrib&4&&(this.normal=b.readFloatArray(this.length));this.attrib&8&&(this.tangent=b.readFloatArray(this.length));if(this.attrib&32)for(this.uv=[],this.uv.length=b.readUByte(),d=2*this.numVertex,a=0;a<this.uv.length;)this.uv[a++]=b.readFloatArray(d);this.attrib&64&&(this.jointPerVertex=b.readUByte(),a=this.numVertex*this.jointPerVertex,this.joint=b.readUShortArray(a),this.weight=b.readFloatArray(a));if(this.attrib&128)for(c=
|
||||
b.readUByte(),this.numColor=((c&64)>>6|(c&128)>>6)+1,this.color=[],a=0,d=c&15;a<d;a++)this.color.push(b.readFloatArray(this.numVertex*this.numColor));this.vertex=b.readFloatArray(this.length);var e=b.readUByte();this.groups=[];if(this.attrib&1024){for(d=a=0;a<e;a++)c=3*b.readVInt(),this.groups.push({start:d,count:c}),d+=c;this.indexes=this.isBig?b.readUIntArray(d):b.readUShortArray(d)}else{var f=this.isBig?4:2,h=new SEA3D.UByteArray;for(c=a=0;a<e;a++)d=3*b.readVInt(),this.groups.push({start:c,count:d}),
|
||||
c+=d,h.add(b.readUByteArray(d*f));this.indexes=this.isBig?new Uint32Array(h.toBuffer()):new Uint16Array(h.toBuffer())}};SEA3D.Geometry.prototype=Object.create(SEA3D.GeometryBase.prototype);SEA3D.Geometry.prototype.constructor=SEA3D.Geometry;SEA3D.Geometry.prototype.type="geo";
|
||||
SEA3D.Object3D=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.isStatic=!1;this.visible=!0;this.attrib=b.readUShort();this.attrib&1&&(this.parent=c.getObject(b.readUInt()));this.attrib&2&&(this.animations=b.readAnimationList(c));this.attrib&4&&(this.scripts=b.readScriptList(c));this.attrib&16&&(this.attributes=c.getObject(b.readUInt()));this.attrib&32&&(a=b.readUByte(),this.isStatic=0!=(a&1),this.visible=0==(a&2))};SEA3D.Object3D.prototype.readTag=function(a,b,c){};
|
||||
SEA3D.Entity3D=function(a,b,c){SEA3D.Object3D.call(this,a,b,c);this.castShadows=!0;this.attrib&64&&(this.castShadows=0==(b.readUByte()&1))};SEA3D.Entity3D.prototype=Object.create(SEA3D.Object3D.prototype);SEA3D.Entity3D.prototype.constructor=SEA3D.Entity3D;SEA3D.Sound3D=function(a,b,c){SEA3D.Object3D.call(this,a,b,c);this.autoPlay=0!=(this.attrib&64);this.attrib&128&&(this.mixer=c.getObject(b.readUInt()));this.sound=c.getObject(b.readUInt());this.volume=b.readFloat()};SEA3D.Sound3D.prototype=Object.create(SEA3D.Object3D.prototype);
|
||||
SEA3D.Sound3D.prototype.constructor=SEA3D.Sound3D;SEA3D.SoundPoint=function(a,b,c){SEA3D.Sound3D.call(this,a,b,c);this.position=b.readVector3();this.distance=b.readFloat();b.readTags(this.readTag.bind(this))};SEA3D.SoundPoint.prototype=Object.create(SEA3D.Sound3D.prototype);SEA3D.SoundPoint.prototype.constructor=SEA3D.SoundPoint;SEA3D.SoundPoint.prototype.type="sp";SEA3D.Container3D=function(a,b,c){SEA3D.Object3D.call(this,a,b,c);this.transform=b.readMatrix();b.readTags(this.readTag.bind(this))};
|
||||
SEA3D.Container3D.prototype=Object.create(SEA3D.Object3D.prototype);SEA3D.Container3D.prototype.constructor=SEA3D.Container3D;SEA3D.Container3D.prototype.type="c3d";SEA3D.ScriptURL=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.url=b.readUTF8(b.length)};SEA3D.ScriptURL.prototype.type="src";SEA3D.TextureURL=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.url=b.readUTF8(b.length)};SEA3D.TextureURL.prototype.type="urlT";
|
||||
SEA3D.CubeMapURL=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.faces=[];for(a=0;6>a;a++)this.faces[a]=b.readUTF8Tiny()};SEA3D.CubeMapURL.prototype.type="cURL";
|
||||
SEA3D.Actions=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.count=b.readUInt();this.actions=[];for(a=0;a<this.count;a++){var d=b.readUByte(),e=b.readUShort(),f=b.readUShort(),h=b.position,g=this.actions[a]={kind:e};d&1&&(g.range=[b.readUInt(),b.readUInt()]);d&2&&(g.time=b.readUInt());d&4&&(g.intrpl=b.readInterpolation(),0==g.intrpl.indexOf("back.")?g.intrplParam0=b.readFloat():0==g.intrpl.indexOf("elastic.")&&(g.intrplParam0=b.readFloat(),g.intrplParam1=b.readFloat()));switch(e){case SEA3D.Actions.RTT_TARGET:g.source=
|
||||
c.getObject(b.readUInt());g.target=c.getObject(b.readUInt());break;case SEA3D.Actions.LOOK_AT:g.source=c.getObject(b.readUInt());g.target=c.getObject(b.readUInt());break;case SEA3D.Actions.PLAY_SOUND:g.sound=c.getObject(b.readUInt());g.offset=b.readUInt();break;case SEA3D.Actions.PLAY_ANIMATION:g.object=c.getObject(b.readUInt());g.name=b.readUTF8Tiny();break;case SEA3D.Actions.FOG:g.color=b.readUInt24();g.min=b.readFloat();g.max=b.readFloat();break;case SEA3D.Actions.ENVIRONMENT:g.texture=c.getObject(b.readUInt());
|
||||
break;case SEA3D.Actions.ENVIRONMENT_COLOR:g.color=b.readUInt24F();break;case SEA3D.Actions.CAMERA:g.camera=c.getObject(b.readUInt());break;case SEA3D.Actions.SCRIPTS:g.scripts=b.readScriptList(c);break;case SEA3D.Actions.CLASS_OF:g.classof=c.getObject(b.readUInt());break;case SEA3D.Actions.ATTRIBUTES:g.attributes=c.getObject(b.readUInt());break;default:console.log('Action "'+e+'" not found.')}b.position=h+f}};SEA3D.Actions.SCENE=0;SEA3D.Actions.ENVIRONMENT_COLOR=1;SEA3D.Actions.ENVIRONMENT=2;
|
||||
SEA3D.Actions.FOG=3;SEA3D.Actions.PLAY_ANIMATION=4;SEA3D.Actions.PLAY_SOUND=5;SEA3D.Actions.ANIMATION_AUDIO_SYNC=6;SEA3D.Actions.LOOK_AT=7;SEA3D.Actions.RTT_TARGET=8;SEA3D.Actions.CAMERA=9;SEA3D.Actions.SCRIPTS=10;SEA3D.Actions.CLASS_OF=11;SEA3D.Actions.ATTRIBUTES=12;SEA3D.Actions.prototype.type="act";SEA3D.Properties=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.tag=b.readProperties(c);this.tag.__name=a};SEA3D.Properties.prototype.type="prop";
|
||||
SEA3D.FileInfo=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.tag=b.readProperties(c);this.tag.__name=a;c.info=this.tag};SEA3D.FileInfo.prototype.type="info";SEA3D.JavaScript=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.src=b.readUTF8(b.length)};SEA3D.JavaScript.prototype.type="js";SEA3D.JavaScriptMethod=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;a=b.readUShort();this.methods={};for(c=0;c<a;c++){b.readUByte();var d=b.readUTF8Tiny();this.methods[d]={src:b.readUTF8Long()}}};
|
||||
SEA3D.JavaScriptMethod.prototype.type="jsm";SEA3D.GLSL=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.src=b.readUTF8(b.length)};SEA3D.GLSL.prototype.type="glsl";SEA3D.Dummy=function(a,b,c){SEA3D.Object3D.call(this,a,b,c);this.transform=b.readMatrix();this.width=b.readFloat();this.height=b.readFloat();this.depth=b.readFloat();b.readTags(this.readTag.bind(this))};SEA3D.Dummy.prototype=Object.create(SEA3D.Object3D.prototype);SEA3D.Dummy.prototype.constructor=SEA3D.Dummy;
|
||||
SEA3D.Dummy.prototype.type="dmy";SEA3D.Line=function(a,b,c){SEA3D.Object3D.call(this,a,b,c);this.count=3*(this.attrib&64?b.readUInt():b.readUShort());this.closed=0!=(this.attrib&128);this.transform=b.readMatrix();this.vertex=[];for(a=0;a<this.count;)this.vertex[a++]=b.readFloat();b.readTags(this.readTag.bind(this))};SEA3D.Line.prototype=Object.create(SEA3D.Object3D.prototype);SEA3D.Line.prototype.constructor=SEA3D.Line;SEA3D.Line.prototype.type="line";
|
||||
SEA3D.Sprite=function(a,b,c){SEA3D.Object3D.call(this,a,b,c);this.attrib&256&&(this.material=c.getObject(b.readUInt()));this.position=b.readVector3();this.width=b.readFloat();this.height=b.readFloat();b.readTags(this.readTag.bind(this))};SEA3D.Sprite.prototype=Object.create(SEA3D.Object3D.prototype);SEA3D.Sprite.prototype.constructor=SEA3D.Sprite;SEA3D.Sprite.prototype.type="m2d";
|
||||
SEA3D.Mesh=function(a,b,c){SEA3D.Entity3D.call(this,a,b,c);if(this.attrib&256)if(this.material=[],a=b.readUByte(),1==a)this.material[0]=c.getObject(b.readUInt());else for(var d=0;d<a;){var e=b.readUInt();0<e?this.material[d++]=c.getObject(e-1):this.material[d++]=void 0}if(this.attrib&512)for(this.modifiers=[],a=b.readUByte(),d=0;d<a;d++)this.modifiers[d]=c.getObject(b.readUInt());this.attrib&1024&&(this.reference={type:b.readUByte(),ref:c.getObject(b.readUInt())});this.transform=b.readMatrix();this.geometry=
|
||||
c.getObject(b.readUInt());b.readTags(this.readTag.bind(this))};SEA3D.Mesh.prototype=Object.create(SEA3D.Entity3D.prototype);SEA3D.Mesh.prototype.constructor=SEA3D.Mesh;SEA3D.Mesh.prototype.type="m3d";SEA3D.Skeleton=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;a=b.readUShort();this.joint=[];for(c=0;c<a;c++)this.joint[c]={name:b.readUTF8Tiny(),parentIndex:b.readUShort()-1,inverseBindMatrix:b.readMatrix()}};SEA3D.Skeleton.prototype.type="skl";
|
||||
SEA3D.SkeletonLocal=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;a=b.readUShort();this.joint=[];for(c=0;c<a;c++)this.joint[c]={name:b.readUTF8Tiny(),parentIndex:b.readUShort()-1,x:b.readFloat(),y:b.readFloat(),z:b.readFloat(),qx:b.readFloat(),qy:b.readFloat(),qz:b.readFloat(),qw:b.readFloat()}};SEA3D.SkeletonLocal.prototype.type="sklq";
|
||||
SEA3D.AnimationBase=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;a=b.readUByte();this.sequence=[];if(a&1){c=b.readUShort();for(var d=0;d<c;d++)a=b.readUByte(),this.sequence[d]={name:b.readUTF8Tiny(),start:b.readUInt(),count:b.readUInt(),repeat:0!=(a&1),intrpl:0==(a&2)}}this.frameRate=b.readUByte();this.numFrames=b.readUInt();0==this.sequence.length&&(this.sequence[0]={name:"root",start:0,count:this.numFrames,repeat:!0,intrpl:!0})};
|
||||
SEA3D.Animation=function(a,b,c){SEA3D.AnimationBase.call(this,a,b,c);this.dataList=[];a=0;for(c=b.readUByte();a<c;a++){var d=b.readUShort(),e=b.readUByte(),f=b.readVector(e,this.numFrames,0);this.dataList.push({kind:d,type:e,blockSize:SEA3D.Stream.sizeOf(e),data:f})}};SEA3D.Animation.POSITION=0;SEA3D.Animation.ROTATION=1;SEA3D.Animation.SCALE=2;SEA3D.Animation.COLOR=3;SEA3D.Animation.MULTIPLIER=4;SEA3D.Animation.ATTENUATION_START=5;SEA3D.Animation.ATTENUATION_END=6;SEA3D.Animation.FOV=7;
|
||||
SEA3D.Animation.OFFSET_U=8;SEA3D.Animation.OFFSET_V=9;SEA3D.Animation.SCALE_U=10;SEA3D.Animation.SCALE_V=11;SEA3D.Animation.ANGLE=12;SEA3D.Animation.ALPHA=13;SEA3D.Animation.VOLUME=14;SEA3D.Animation.DefaultLerpFuncs=[SEA3D.Math.lerp3x,SEA3D.Math.lerpQuat4x,SEA3D.Math.lerp3x,SEA3D.Math.lerpColor1x,SEA3D.Math.lerp1x,SEA3D.Math.lerp1x,SEA3D.Math.lerp1x,SEA3D.Math.lerp1x,SEA3D.Math.lerp1x,SEA3D.Math.lerp1x,SEA3D.Math.lerp1x,SEA3D.Math.lerp1x,SEA3D.Math.lerpAng1x,SEA3D.Math.lerp1x,SEA3D.Math.lerp1x];
|
||||
SEA3D.Animation.prototype=Object.create(SEA3D.AnimationBase.prototype);SEA3D.Animation.prototype.constructor=SEA3D.Animation;SEA3D.Animation.prototype.type="anm";SEA3D.SkeletonAnimation=function(a,b,c){SEA3D.AnimationBase.call(this,a,b,c);this.name=a;this.data=b;this.sea3d=c;this.numJoints=b.readUShort();this.raw=b.readFloatArray(this.numFrames*this.numJoints*7)};SEA3D.SkeletonAnimation.prototype.type="skla";
|
||||
SEA3D.Morph=function(a,b,c){SEA3D.GeometryBase.call(this,a,b,c);a=0!=(this.attrib&2);c=0!=(this.attrib&4);var d=b.readUShort();this.node=[];for(var e=0;e<d;e++){var f=b.readUTF8Tiny(),h,g;a&&(h=b.readFloatArray(this.length));c&&(g=b.readFloatArray(this.length));this.node[e]={vertex:h,normal:g,name:f}}};SEA3D.Morph.prototype=Object.create(SEA3D.GeometryBase.prototype);SEA3D.Morph.prototype.constructor=SEA3D.Morph;SEA3D.Morph.prototype.type="mph";
|
||||
SEA3D.VertexAnimation=function(a,b,c){SEA3D.AnimationBase.call(this,a,b,c);c=b.readUByte();this.isBig=0!=(c&1);b.readVInt=this.isBig?b.readUInt:b.readUShort;this.numVertex=b.readVInt();this.length=3*this.numVertex;a=0!=(c&2);c=0!=(c&4);this.frame=[];var d,e,f;for(d=0;d<this.numFrames;d++)a&&(e=b.readFloatArray(this.length)),c&&(f=b.readFloatArray(this.length)),this.frame[d]={vertex:e,normal:f}};SEA3D.VertexAnimation.prototype=Object.create(SEA3D.AnimationBase.prototype);
|
||||
SEA3D.VertexAnimation.prototype.constructor=SEA3D.VertexAnimation;SEA3D.VertexAnimation.prototype.type="vtxa";SEA3D.Camera=function(a,b,c){SEA3D.Object3D.call(this,a,b,c);this.attrib&64&&(this.dof={distance:b.readFloat(),range:b.readFloat()});this.transform=b.readMatrix();this.fov=b.readFloat();b.readTags(this.readTag.bind(this))};SEA3D.Camera.prototype=Object.create(SEA3D.Object3D.prototype);SEA3D.Camera.prototype.constructor=SEA3D.Camera;SEA3D.Camera.prototype.type="cam";
|
||||
SEA3D.OrthographicCamera=function(a,b,c){SEA3D.Object3D.call(this,a,b,c);this.transform=b.readMatrix();this.height=b.readFloat();b.readTags(this.readTag.bind(this))};SEA3D.OrthographicCamera.prototype=Object.create(SEA3D.Object3D.prototype);SEA3D.OrthographicCamera.prototype.constructor=SEA3D.OrthographicCamera;SEA3D.OrthographicCamera.prototype.type="camo";SEA3D.JointObject=function(a,b,c){SEA3D.Object3D.call(this,a,b,c);this.target=c.getObject(b.readUInt());this.joint=b.readUShort();b.readTags(this.readTag.bind(this))};
|
||||
SEA3D.JointObject.prototype=Object.create(SEA3D.Object3D.prototype);SEA3D.JointObject.prototype.constructor=SEA3D.JointObject;SEA3D.JointObject.prototype.type="jnt";
|
||||
SEA3D.Light=function(a,b,c){SEA3D.Object3D.call(this,a,b,c);this.attenEnd=this.attenStart=Number.MAX_VALUE;this.attrib&64&&(a=b.readUByte(),this.shadow={},this.shadow.opacity=a&1?b.readFloat():1,this.shadow.color=a&2?b.readUInt24():0);this.attrib&512&&(this.attenStart=b.readFloat(),this.attenEnd=b.readFloat());this.color=b.readUInt24();this.multiplier=b.readFloat()};SEA3D.Light.prototype=Object.create(SEA3D.Object3D.prototype);SEA3D.Light.prototype.constructor=SEA3D.Light;
|
||||
SEA3D.PointLight=function(a,b,c){SEA3D.Light.call(this,a,b,c);this.attrib&128&&(this.attenuation={start:b.readFloat(),end:b.readFloat()});this.position=b.readVector3();b.readTags(this.readTag.bind(this))};SEA3D.PointLight.prototype=Object.create(SEA3D.Light.prototype);SEA3D.PointLight.prototype.constructor=SEA3D.PointLight;SEA3D.PointLight.prototype.type="plht";
|
||||
SEA3D.HemisphereLight=function(a,b,c){SEA3D.Light.call(this,a,b,c);this.attrib&128&&(this.attenuation={start:b.readFloat(),end:b.readFloat()});this.secondColor=b.readUInt24();b.readTags(this.readTag.bind(this))};SEA3D.HemisphereLight.prototype=Object.create(SEA3D.Light.prototype);SEA3D.HemisphereLight.prototype.constructor=SEA3D.HemisphereLight;SEA3D.HemisphereLight.prototype.type="hlht";SEA3D.AmbientLight=function(a,b,c){SEA3D.Light.call(this,a,b,c);b.readTags(this.readTag.bind(this))};
|
||||
SEA3D.AmbientLight.prototype=Object.create(SEA3D.Light.prototype);SEA3D.AmbientLight.prototype.constructor=SEA3D.AmbientLight;SEA3D.AmbientLight.prototype.type="alht";SEA3D.DirectionalLight=function(a,b,c){SEA3D.Light.call(this,a,b,c);this.transform=b.readMatrix();b.readTags(this.readTag.bind(this))};SEA3D.DirectionalLight.prototype=Object.create(SEA3D.Light.prototype);SEA3D.DirectionalLight.prototype.constructor=SEA3D.DirectionalLight;SEA3D.DirectionalLight.prototype.type="dlht";
|
||||
SEA3D.Material=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.technique=[];this.attrib=b.readUShort();this.alpha=1;this.blendMode="normal";this.anisotropy=this.physical=!1;this.bothSides=0!=(this.attrib&1);this.receiveLights=0==(this.attrib&2);this.receiveShadows=0==(this.attrib&4);this.receiveFog=0==(this.attrib&8);this.repeat=0==(this.attrib&16);this.attrib&32&&(this.alpha=b.readFloat());this.attrib&64&&(this.blendMode=b.readBlendMode());this.attrib&128&&(this.animations=b.readAnimationList(c));
|
||||
this.depthMask=0==(this.attrib&256);this.depthTest=0==(this.attrib&512);a=b.readUByte();for(var d=0;d<a;++d){var e=b.readUShort(),f=b.readUShort(),h=b.position,g,k;switch(e){case SEA3D.Material.PHONG:g={ambientColor:b.readUInt24(),diffuseColor:b.readUInt24(),specularColor:b.readUInt24(),specular:b.readFloat(),gloss:b.readFloat()};break;case SEA3D.Material.PHYSICAL:this.physical=!0;g={color:b.readUInt24(),roughness:b.readFloat(),metalness:b.readFloat()};break;case SEA3D.Material.ANISOTROPIC:this.anisotropy=
|
||||
!0;break;case SEA3D.Material.COMPOSITE_TEXTURE:g={composite:c.getObject(b.readUInt())};break;case SEA3D.Material.DIFFUSE_MAP:g={texture:c.getObject(b.readUInt())};break;case SEA3D.Material.SPECULAR_MAP:g={texture:c.getObject(b.readUInt())};break;case SEA3D.Material.NORMAL_MAP:g={texture:c.getObject(b.readUInt())};break;case SEA3D.Material.REFLECTION:case SEA3D.Material.FRESNEL_REFLECTION:g={texture:c.getObject(b.readUInt()),alpha:b.readFloat()};e==SEA3D.Material.FRESNEL_REFLECTION&&(g.power=b.readFloat(),
|
||||
g.normal=b.readFloat());break;case SEA3D.Material.REFRACTION:g={texture:c.getObject(b.readUInt()),alpha:b.readFloat(),ior:b.readFloat()};break;case SEA3D.Material.RIM:g={color:b.readUInt24(),strength:b.readFloat(),power:b.readFloat(),blendMode:b.readBlendMode()};break;case SEA3D.Material.LIGHT_MAP:g={texture:c.getObject(b.readUInt()),channel:b.readUByte(),blendMode:b.readBlendMode()};break;case SEA3D.Material.DETAIL_MAP:g={texture:c.getObject(b.readUInt()),scale:b.readFloat(),blendMode:b.readBlendMode()};
|
||||
break;case SEA3D.Material.CEL:g={color:b.readUInt24(),levels:b.readUByte(),size:b.readFloat(),specularCutOff:b.readFloat(),smoothness:b.readFloat()};break;case SEA3D.Material.TRANSLUCENT:g={translucency:b.readFloat(),scattering:b.readFloat()};break;case SEA3D.Material.BLEND_NORMAL_MAP:k=b.readUByte();g={texture:c.getObject(b.readUInt()),secondaryTexture:c.getObject(b.readUInt())};k&1?(g.offsetX0=b.readFloat(),g.offsetY0=b.readFloat(),g.offsetX1=b.readFloat(),g.offsetY1=b.readFloat()):g.offsetX0=g.offsetY0=
|
||||
g.offsetX1=g.offsetY1=0;g.animate=k&2;break;case SEA3D.Material.MIRROR_REFLECTION:g={texture:c.getObject(b.readUInt()),alpha:b.readFloat()};break;case SEA3D.Material.AMBIENT_MAP:g={texture:c.getObject(b.readUInt())};break;case SEA3D.Material.ALPHA_MAP:g={texture:c.getObject(b.readUInt())};break;case SEA3D.Material.EMISSIVE:g={color:b.readUInt24()};break;case SEA3D.Material.EMISSIVE_MAP:g={texture:c.getObject(b.readUInt())};break;case SEA3D.Material.ROUGHNESS_MAP:case SEA3D.Material.METALNESS_MAP:g=
|
||||
{texture:c.getObject(b.readUInt())};break;case SEA3D.Material.VERTEX_COLOR:g={blendMode:b.readBlendMode()};break;case SEA3D.Material.WRAP_LIGHTING:g={color:b.readUInt24(),strength:b.readFloat()};break;case SEA3D.Material.COLOR_REPLACE:k=b.readUByte();g={red:b.readUInt24(),green:b.readUInt24(),blue:b.readUInt24F()};k&1&&(g.mask=c.getObject(b.readUInt()));k&2&&(g.alpha=b.readFloat());break;case SEA3D.Material.REFLECTION_SPHERICAL:g={texture:c.getObject(b.readUInt()),alpha:b.readFloat()};break;default:console.warn("SEA3D: MaterialTechnique not found:",
|
||||
e.toString(16));b.position=h+f;continue}g.kind=e;this.technique.push(g);b.position=h+f}};SEA3D.Material.PHONG=0;SEA3D.Material.COMPOSITE_TEXTURE=1;SEA3D.Material.DIFFUSE_MAP=2;SEA3D.Material.SPECULAR_MAP=3;SEA3D.Material.REFLECTION=4;SEA3D.Material.REFRACTION=5;SEA3D.Material.NORMAL_MAP=6;SEA3D.Material.FRESNEL_REFLECTION=7;SEA3D.Material.RIM=8;SEA3D.Material.LIGHT_MAP=9;SEA3D.Material.DETAIL_MAP=10;SEA3D.Material.CEL=11;SEA3D.Material.TRANSLUCENT=12;SEA3D.Material.BLEND_NORMAL_MAP=13;
|
||||
SEA3D.Material.MIRROR_REFLECTION=14;SEA3D.Material.AMBIENT_MAP=15;SEA3D.Material.ALPHA_MAP=16;SEA3D.Material.EMISSIVE_MAP=17;SEA3D.Material.VERTEX_COLOR=18;SEA3D.Material.WRAP_LIGHTING=19;SEA3D.Material.COLOR_REPLACE=20;SEA3D.Material.REFLECTION_SPHERICAL=21;SEA3D.Material.ANISOTROPIC=22;SEA3D.Material.EMISSIVE=23;SEA3D.Material.PHYSICAL=24;SEA3D.Material.ROUGHNESS_MAP=25;SEA3D.Material.METALNESS_MAP=26;SEA3D.Material.prototype.type="mat";
|
||||
SEA3D.Composite=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;a=b.readUByte();this.layer=[];for(var d=0;d<a;d++)this.layer[d]=new SEA3D.Composite.prototype.Layer(b,c)};SEA3D.Composite.prototype.getLayerByName=function(a){for(var b=0;b<this.layer.length;b++)if(this.layer[b].name==a)return this.layer[b]};
|
||||
SEA3D.Composite.prototype.Layer=function(a,b){var c=a.readUShort();c&1?this.texture=new SEA3D.Composite.LayerBitmap(a,b):this.color=a.readUInt24();c&2&&(this.mask=new SEA3D.Composite.LayerBitmap(a,b));c&4&&(this.name=a.readUTF8Tiny());this.blendMode=c&8?a.readBlendMode():"normal";this.opacity=c&16?a.readFloat():1};
|
||||
SEA3D.Composite.LayerBitmap=function(a,b){this.map=b.getObject(a.readUInt());var c=a.readUShort();this.channel=c&1?a.readUByte():0;this.repeat=c&0;this.offsetU=c&4?a.readFloat():0;this.offsetV=c&8?a.readFloat():0;this.scaleU=c&16?a.readFloat():1;this.scaleV=c&32?a.readFloat():1;this.rotation=c&64?a.readFloat():0;c&128&&(this.animation=a.readAnimationList(b))};SEA3D.Composite.prototype.type="ctex";
|
||||
SEA3D.PlanarRender=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.attrib=b.readUByte();this.quality=this.attrib&1|this.attrib&2;this.transform=b.readMatrix()};SEA3D.PlanarRender.prototype.type="rttp";SEA3D.CubeRender=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.attrib=b.readUByte();this.quality=this.attrib&1|this.attrib&2;this.position=b.readVector3()};SEA3D.CubeRender.prototype.type="rttc";
|
||||
SEA3D.CubeMap=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.transparent=!1;b.readExt();this.faces=[];for(a=0;6>a;a++)c=b.readUInt(),this.faces[a]=b.concat(b.position,c),b.position+=c};SEA3D.CubeMap.prototype.type="cmap";SEA3D.JPEG=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.transparent=!1};SEA3D.JPEG.prototype.type="jpg";SEA3D.JPEG_XR=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.transparent=!0};SEA3D.JPEG_XR.prototype.type="wdp";
|
||||
SEA3D.PNG=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.transparent=6==b.getByte(25)};SEA3D.PNG.prototype.type="png";SEA3D.GIF=function(a,b,c){this.name=a;this.data=b;this.sea3d=c;this.transparent=0<b.getByte(11)};SEA3D.GIF.prototype.type="gif";SEA3D.OGG=function(a,b,c){this.name=a;this.data=b;this.sea3d=c};SEA3D.OGG.prototype.type="ogg";SEA3D.MP3=function(a,b,c){this.name=a;this.data=b;this.sea3d=c};SEA3D.MP3.prototype.type="mp3";
|
||||
SEA3D.File=function(a){this.config={streaming:!0,timeLimit:60};a&&(void 0!==a.streaming&&(this.config.streaming=a.streaming),void 0!==a.timeLimit&&(this.config.timeLimit=a.timeLimit));this.version=SEA3D.VERSION;this.objects=[];this.typeClass={};this.typeRead={};this.typeUnique={};this.position=this.dataPosition=0;this.scope=this;this.addClass(SEA3D.FileInfo,!0);this.addClass(SEA3D.Geometry,!0);this.addClass(SEA3D.Mesh);this.addClass(SEA3D.Sprite);this.addClass(SEA3D.Material);this.addClass(SEA3D.Composite);
|
||||
this.addClass(SEA3D.PointLight);this.addClass(SEA3D.DirectionalLight);this.addClass(SEA3D.HemisphereLight);this.addClass(SEA3D.AmbientLight);this.addClass(SEA3D.Skeleton,!0);this.addClass(SEA3D.SkeletonLocal,!0);this.addClass(SEA3D.SkeletonAnimation,!0);this.addClass(SEA3D.JointObject);this.addClass(SEA3D.Camera);this.addClass(SEA3D.OrthographicCamera);this.addClass(SEA3D.Morph,!0);this.addClass(SEA3D.VertexAnimation,!0);this.addClass(SEA3D.CubeMap,!0);this.addClass(SEA3D.Animation);this.addClass(SEA3D.Dummy);
|
||||
this.addClass(SEA3D.Line);this.addClass(SEA3D.SoundPoint);this.addClass(SEA3D.PlanarRender);this.addClass(SEA3D.CubeRender);this.addClass(SEA3D.Actions);this.addClass(SEA3D.Container3D);this.addClass(SEA3D.Properties);this.addClass(SEA3D.ScriptURL,!0);this.addClass(SEA3D.TextureURL,!0);this.addClass(SEA3D.CubeMapURL,!0);this.addClass(SEA3D.JPEG,!0);this.addClass(SEA3D.JPEG_XR,!0);this.addClass(SEA3D.PNG,!0);this.addClass(SEA3D.GIF,!0);this.addClass(SEA3D.OGG,!0);this.addClass(SEA3D.MP3,!0);this.addClass(SEA3D.JavaScript,
|
||||
!0);this.addClass(SEA3D.JavaScriptMethod,!0);this.addClass(SEA3D.GLSL,!0);for(a=SEA3D.File.Extensions.length;a--;)SEA3D.File.Extensions[a].call(this)};SEA3D.File.Extensions=[];SEA3D.File.CompressionLibs={};SEA3D.File.DecompressionMethod={};SEA3D.File.setExtension=function(a){SEA3D.File.Extensions.push(a)};SEA3D.File.setDecompressionEngine=function(a,b,c){SEA3D.File.CompressionLibs[a]=b;SEA3D.File.DecompressionMethod[a]=c};
|
||||
SEA3D.File.prototype.addClass=function(a,b){this.typeClass[a.prototype.type]=a;this.typeUnique[a.prototype.type]=!0===b};
|
||||
SEA3D.File.prototype.readHead=function(){if(16>this.stream.bytesAvailable)return!1;if("SEA"!=this.stream.readUTF8(3))throw Error("Invalid SEA3D format.");this.sign=this.stream.readUTF8(3);this.version=this.stream.readUInt24();if(0!=this.stream.readUByte())throw Error("Protection algorithm not compatible.");this.compressionID=this.stream.readUByte();this.compressionAlgorithm=SEA3D.File.CompressionLibs[this.compressionID];this.decompressionMethod=SEA3D.File.DecompressionMethod[this.compressionID];if(0<
|
||||
this.compressionID&&!this.decompressionMethod)throw Error("Compression algorithm not compatible.");this.length=this.stream.readUInt();this.dataPosition=this.stream.position;this.objects.length=0;this.state=this.readBody;if(this.onHead)this.onHead({file:this,sign:this.sign});return!0};SEA3D.File.prototype.getObject=function(a){return this.objects[a]};SEA3D.File.prototype.getObjectByName=function(a){return this.objects[a]};
|
||||
SEA3D.File.prototype.readSEAObject=function(){if(4>this.stream.bytesAvailable)return null;var a=this.stream.readUInt(),b=this.stream.position;if(this.stream.bytesAvailable<a)return null;var c=this.stream.readUByte(),d=this.stream.readExt(),e=null,f=c&1?this.stream.readUTF8Tiny():"",h=0!=(c&2),g=0!=(c&4);c&8&&(e=this.stream.readUShort(),c=this.stream.concat(this.stream.position,e),this.stream.position+=e,h&&this.decompressionMethod&&(c.buffer=this.decompressionMethod(c.buffer)),e=c.readProperties(this));
|
||||
a-=this.stream.position-b;b=this.stream.position;c=this.stream.concat(b,a);this.typeClass[d]?(h&&this.decompressionMethod&&(c.buffer=this.decompressionMethod(c.buffer)),h=new this.typeClass[d](f,c,this),(this.config.streaming&&g||this.config.forceStreaming)&&this.typeRead[d]&&this.typeRead[d].call(this.scope,h)):(h=new SEA3D.Object(f,c,d,this),console.warn('SEA3D: Unknown format "'+d+'" of file "'+f+'". Add a module referring for this format.'));h.streaming=g;h.metadata=e;this.objects.push(this.objects[h.name+
|
||||
"."+h.type]=h);this.dataPosition=b+a;++this.position;return h};SEA3D.File.prototype.isDone=function(){return this.position==this.length};SEA3D.File.prototype.readBody=function(){this.timer.update();if(!this.resume)return!1;for(;this.position<this.length;)if(this.timer.deltaTime<this.config.timeLimit){this.stream.position=this.dataPosition;var a=this.readSEAObject();if(a)this.dispatchCompleteObject(a);else return!1}else return!1;this.state=this.readComplete;return!0};
|
||||
SEA3D.File.prototype.initParse=function(){this.timer=new SEA3D.Timer;this.position=0;this.resume=!0};SEA3D.File.prototype.parse=function(){this.initParse();isFinite(this.config.timeLimit)?setTimeout(this.parseObject.bind(this),10):this.parseObject()};
|
||||
SEA3D.File.prototype.parseObject=function(){for(this.timer.update();this.position<this.length&&this.timer.deltaTime<this.config.timeLimit;){var a=this.objects[this.position++],b=a.type;this.typeUnique[b]||delete a.tag;(a.streaming||this.config.forceStreaming)&&this.typeRead[b]&&void 0==a.tag&&this.typeRead[b].call(this.scope,a)}if(this.position==this.length)if(a=this.timer.elapsedTime,b=a+"ms, "+this.objects.length+" objects",this.onParseComplete)this.onParseComplete({file:this,timeTotal:a,message:b});
|
||||
else console.log("SEA3D Parse Complete:",b);else{if(this.onParseProgress)this.onParseProgress({file:this,loaded:this.position,total:this.length});setTimeout(this.parseObject.bind(this),10)}};SEA3D.File.prototype.readComplete=function(){this.stream.position=this.dataPosition;6202321!=this.stream.readUInt24F()&&console.warn("SEA3D file is corrupted.");delete this.state;return!1};
|
||||
SEA3D.File.prototype.readState=function(){for(;this.state(););this.state?(requestAnimationFrame(this.readState.bind(this)),this.dispatchProgress()):(this.dispatchProgress(),this.dispatchComplete())};SEA3D.File.prototype.read=function(a){a||Error("No data found.");this.initParse();this.stream=new SEA3D.Stream(a);this.state=this.readHead;this.readState()};SEA3D.File.prototype.dispatchCompleteObject=function(a){if(this.onCompleteObject)this.onCompleteObject({file:this,object:a})};
|
||||
SEA3D.File.prototype.dispatchProgress=function(){if(this.onProgress)this.onProgress({file:this,loaded:this.position,total:this.length})};SEA3D.File.prototype.dispatchDownloadProgress=function(a,b){if(this.onDownloadProgress)this.onDownloadProgress({file:this,loaded:a,total:b})};SEA3D.File.prototype.dispatchComplete=function(){var a=this.timer.elapsedTime,b=a+"ms, "+this.objects.length+" objects";if(this.onComplete)this.onComplete({file:this,timeTotal:a,message:b});else console.log("SEA3D:",b)};
|
||||
SEA3D.File.prototype.dispatchError=function(a,b){if(this.onError)this.onError({file:this,id:a,message:b});else console.error("SEA3D: #"+a,b)};
|
||||
SEA3D.File.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onprogress=function(a){a.lengthComputable&&b.dispatchDownloadProgress(a.loaded,a.total)};c.onreadystatechange=function(){2!==c.readyState&&3!==c.readyState&&4===c.readyState&&(200===c.status||0===c.status?b.read(this.response):this.dispatchError(1001,"Couldn't load ["+a+"] ["+c.status+"]"))};c.send()};SEA3D.LZMA=function(){var a=a||{};a.OutWindow=function(){this._windowSize=0};a.OutWindow.prototype.create=function(a){this._buffer&&this._windowSize===a||(this._buffer=[]);this._windowSize=a;this._streamPos=this._pos=0};a.OutWindow.prototype.flush=function(){var a=this._pos-this._streamPos;if(0!==a){for(;a--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0);this._streamPos=this._pos}};a.OutWindow.prototype.releaseStream=function(){this.flush();this._stream=
|
||||
null};a.OutWindow.prototype.setStream=function(a){this.releaseStream();this._stream=a};a.OutWindow.prototype.init=function(a){a||(this._pos=this._streamPos=0)};a.OutWindow.prototype.copyBlock=function(a,c){var d=this._pos-a-1;for(0>d&&(d+=this._windowSize);c--;)d>=this._windowSize&&(d=0),this._buffer[this._pos++]=this._buffer[d++],this._pos>=this._windowSize&&this.flush()};a.OutWindow.prototype.putByte=function(a){this._buffer[this._pos++]=a;this._pos>=this._windowSize&&this.flush()};a.OutWindow.prototype.getByte=
|
||||
function(a){a=this._pos-a-1;0>a&&(a+=this._windowSize);return this._buffer[a]};a.RangeDecoder=function(){};a.RangeDecoder.prototype.setStream=function(a){this._stream=a};a.RangeDecoder.prototype.releaseStream=function(){this._stream=null};a.RangeDecoder.prototype.init=function(){var a=5;this._code=0;for(this._range=-1;a--;)this._code=this._code<<8|this._stream.readByte()};a.RangeDecoder.prototype.decodeDirectBits=function(a){for(var c=0,d;a--;)this._range>>>=1,d=this._code-this._range>>>31,this._code-=
|
||||
this._range&d-1,c=c<<1|1-d,0===(this._range&4278190080)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return c};a.RangeDecoder.prototype.decodeBit=function(a,c){var d=a[c],e=(this._range>>>11)*d;if((this._code^2147483648)<(e^2147483648))return this._range=e,a[c]+=2048-d>>>5,0===(this._range&4278190080)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0;this._range-=e;this._code-=e;a[c]-=d>>>5;0===(this._range&4278190080)&&(this._code=this._code<<8|this._stream.readByte(),
|
||||
this._range<<=8);return 1};a.initBitModels=function(a,c){for(;c--;)a[c]=1024};a.BitTreeDecoder=function(a){this._models=[];this._numBitLevels=a};a.BitTreeDecoder.prototype.init=function(){a.initBitModels(this._models,1<<this._numBitLevels)};a.BitTreeDecoder.prototype.decode=function(a){for(var c=1,d=this._numBitLevels;d--;)c=c<<1|a.decodeBit(this._models,c);return c-(1<<this._numBitLevels)};a.BitTreeDecoder.prototype.reverseDecode=function(a){for(var c=1,d=0,e=0,f;e<this._numBitLevels;++e)f=a.decodeBit(this._models,
|
||||
c),c=c<<1|f,d|=f<<e;return d};a.reverseDecode2=function(a,c,d,e){for(var f=1,h=0,g=0,k;g<e;++g)k=d.decodeBit(a,c+f),f=f<<1|k,h|=k<<g;return h};a.LenDecoder=function(){this._choice=[];this._lowCoder=[];this._midCoder=[];this._highCoder=new a.BitTreeDecoder(8);this._numPosStates=0};a.LenDecoder.prototype.create=function(b){for(;this._numPosStates<b;++this._numPosStates)this._lowCoder[this._numPosStates]=new a.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new a.BitTreeDecoder(3)};a.LenDecoder.prototype.init=
|
||||
function(){var b=this._numPosStates;for(a.initBitModels(this._choice,2);b--;)this._lowCoder[b].init(),this._midCoder[b].init();this._highCoder.init()};a.LenDecoder.prototype.decode=function(a,c){return 0===a.decodeBit(this._choice,0)?this._lowCoder[c].decode(a):0===a.decodeBit(this._choice,1)?8+this._midCoder[c].decode(a):16+this._highCoder.decode(a)};a.Decoder2=function(){this._decoders=[]};a.Decoder2.prototype.init=function(){a.initBitModels(this._decoders,768)};a.Decoder2.prototype.decodeNormal=
|
||||
function(a){var c=1;do c=c<<1|a.decodeBit(this._decoders,c);while(256>c);return c&255};a.Decoder2.prototype.decodeWithMatchByte=function(a,c){var d=1,e,f;do if(e=c>>7&1,c<<=1,f=a.decodeBit(this._decoders,(1+e<<8)+d),d=d<<1|f,e!==f){for(;256>d;)d=d<<1|a.decodeBit(this._decoders,d);break}while(256>d);return d&255};a.LiteralDecoder=function(){};a.LiteralDecoder.prototype.create=function(b,c){var d;if(!this._coders||this._numPrevBits!==c||this._numPosBits!==b)for(this._numPosBits=b,this._posMask=(1<<
|
||||
b)-1,this._numPrevBits=c,this._coders=[],d=1<<this._numPrevBits+this._numPosBits;d--;)this._coders[d]=new a.Decoder2};a.LiteralDecoder.prototype.init=function(){for(var a=1<<this._numPrevBits+this._numPosBits;a--;)this._coders[a].init()};a.LiteralDecoder.prototype.getDecoder=function(a,c){return this._coders[((a&this._posMask)<<this._numPrevBits)+((c&255)>>>8-this._numPrevBits)]};a.Decoder=function(){this._outWindow=new a.OutWindow;this._rangeDecoder=new a.RangeDecoder;this._isMatchDecoders=[];this._isRepDecoders=
|
||||
[];this._isRepG0Decoders=[];this._isRepG1Decoders=[];this._isRepG2Decoders=[];this._isRep0LongDecoders=[];this._posSlotDecoder=[];this._posDecoders=[];this._posAlignDecoder=new a.BitTreeDecoder(4);this._lenDecoder=new a.LenDecoder;this._repLenDecoder=new a.LenDecoder;this._literalDecoder=new a.LiteralDecoder;this._dictionarySizeCheck=this._dictionarySize=-1;this._posSlotDecoder[0]=new a.BitTreeDecoder(6);this._posSlotDecoder[1]=new a.BitTreeDecoder(6);this._posSlotDecoder[2]=new a.BitTreeDecoder(6);
|
||||
this._posSlotDecoder[3]=new a.BitTreeDecoder(6)};a.Decoder.prototype.setDictionarySize=function(a){if(0>a)return!1;this._dictionarySize!==a&&(this._dictionarySize=a,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096)));return!0};a.Decoder.prototype.setLcLpPb=function(a,c,d){var e=1<<d;if(8<a||4<c||4<d)return!1;this._literalDecoder.create(c,a);this._lenDecoder.create(e);this._repLenDecoder.create(e);this._posStateMask=e-1;return!0};
|
||||
a.Decoder.prototype.init=function(){var b=4;this._outWindow.init(!1);a.initBitModels(this._isMatchDecoders,192);a.initBitModels(this._isRep0LongDecoders,192);a.initBitModels(this._isRepDecoders,12);a.initBitModels(this._isRepG0Decoders,12);a.initBitModels(this._isRepG1Decoders,12);a.initBitModels(this._isRepG2Decoders,12);a.initBitModels(this._posDecoders,114);for(this._literalDecoder.init();b--;)this._posSlotDecoder[b].init();this._lenDecoder.init();this._repLenDecoder.init();this._posAlignDecoder.init();
|
||||
this._rangeDecoder.init()};a.Decoder.prototype.decode=function(b,c,d){var e=0,f=0,h=0,g=0,k=0,n=0,l=0;this._rangeDecoder.setStream(b);this._outWindow.setStream(c);for(this.init();0>d||n<d;)if(b=n&this._posStateMask,0===this._rangeDecoder.decodeBit(this._isMatchDecoders,(e<<4)+b))l=this._literalDecoder.getDecoder(n++,l),l=7<=e?l.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(f)):l.decodeNormal(this._rangeDecoder),this._outWindow.putByte(l),e=4>e?0:e-(10>e?3:6);else{if(1===this._rangeDecoder.decodeBit(this._isRepDecoders,
|
||||
e))l=0,0===this._rangeDecoder.decodeBit(this._isRepG0Decoders,e)?0===this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(e<<4)+b)&&(e=7>e?9:11,l=1):(0===this._rangeDecoder.decodeBit(this._isRepG1Decoders,e)?c=h:(0===this._rangeDecoder.decodeBit(this._isRepG2Decoders,e)?c=g:(c=k,k=g),g=h),h=f,f=c),0===l&&(l=2+this._repLenDecoder.decode(this._rangeDecoder,b),e=7>e?8:11);else if(k=g,g=h,h=f,l=2+this._lenDecoder.decode(this._rangeDecoder,b),e=7>e?7:10,b=this._posSlotDecoder[5>=l?l-2:3].decode(this._rangeDecoder),
|
||||
4<=b)if(c=(b>>1)-1,f=(2|b&1)<<c,14>b)f+=a.reverseDecode2(this._posDecoders,f-b-1,this._rangeDecoder,c);else{if(f+=this._rangeDecoder.decodeDirectBits(c-4)<<4,f+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),0>f){if(-1===f)break;return!1}}else f=b;if(f>=n||f>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(f,l);n+=l;l=this._outWindow.getByte(0)}this._outWindow.flush();this._outWindow.releaseStream();this._rangeDecoder.releaseStream();return!0};a.Decoder.prototype.setDecoderProperties=
|
||||
function(a){var c,d;if(5>a.size)return!1;c=a.readByte();d=c%9;c=~~(c/9);if(!this.setLcLpPb(d,c%5,~~(c/5)))return!1;c=a.readByte();c|=a.readByte()<<8;c|=a.readByte()<<16;c+=16777216*a.readByte();return this.setDictionarySize(c)};a.decompress=function(b,c,d,e){var f=new a.Decoder;if(!f.setDecoderProperties(b))throw"Incorrect stream properties";if(!f.decode(c,d,e))throw"Error in data stream";return!0};a.decompressFile=function(b,c){var d=new a.Decoder,e;if(!d.setDecoderProperties(b))throw"Incorrect stream properties";
|
||||
e=b.readByte();e|=b.readByte()<<8;e|=b.readByte()<<16;e+=16777216*b.readByte();b.readByte();b.readByte();b.readByte();b.readByte();if(!d.decode(b,c,e))throw"Error in data stream";return!0};return a}();SEA3D.File.LZMAUncompress=function(a){a=new Uint8Array(a);var b={data:[],position:0,writeByte:function(a){this.data[this.position++]=a}};SEA3D.LZMA.decompressFile({data:a,position:0,readByte:function(){return this.data[this.position++]}},b);return(new Uint8Array(b.data)).buffer};
|
||||
SEA3D.File.setDecompressionEngine(2,"lzma",SEA3D.File.LZMAUncompress);THREE.SEA3D=function(a){this.config={id:"",scripts:!0,runScripts:!0,autoPlay:!1,dummys:!0,multiplier:1,bounding:!0,audioRolloffFactor:10,lights:!0,useEnvironment:!0,useVertexTexture:!0,forceStatic:!1,streaming:!0,async:!0,paths:{},timeLimit:10,premultipliedAlpha:!1,stageWidth:window?window.innerWidth:1024,stageHeight:window?window.innerHeight:1024};a&&this.loadConfig(a)};
|
||||
THREE.SEA3D.prototype=Object.assign(Object.create(THREE.EventDispatcher.prototype),{constructor:THREE.SEA3D,container:{set:function(a){this.config.container=a},get:function(){return this.config.container}}});THREE.SEA3D.Domain=function(a,b,c){this.id=a;this.objects=b;this.container=c;this.sources=[];this.global={};this.scriptTargets=[];this.events=new THREE.EventDispatcher};
|
||||
Object.assign(THREE.SEA3D.Domain.prototype,{add:function(a){this.sources.push(a)},remove:function(a){this.sources.splice(this.sources.indexOf(a),1)},contains:function(a){return-1!=this.sources.indexOf(a)},addEventListener:function(a,b){this.events.addEventListener(a,b)},hasEventListener:function(a,b){return this.events.hasEventListener(a,b)},removeEventListener:function(a,b){this.events.removeEventListener(a,b)},print:function(){console.log.apply(console,arguments)},watch:function(){console.log.apply(console,
|
||||
"watch:",arguments)},runScripts:function(){for(var a=0;a<this.scriptTargets.length;a++)this.runJSMList(this.scriptTargets[a])},runJSMList:function(a){for(var b=a.scripts,c=0;c<b.length;c++)this.runJSM(a,b[c]);return b},runJSM:function(a,b){void 0==a.local&&(a.local={});var c={print:this.print,watch:this.watch,sea3d:this,scene:this.container,source:new THREE.SEA3D.ScriptDomain(this,a instanceof THREE.SEA3D.Domain)};Object.freeze(c.source);THREE.SEA3D.ScriptHandler.add(c.source);try{this.methods[b.method](c,
|
||||
this.getReference,this.global,a.local,a,b.params)}catch(d){console.error('SEA3D JavaScript: Error running method "'+b.method+'".'),console.error(d)}},getReference:function(a){return eval(a)},disposeList:function(a){if(a&&a.length){a=a.concat();for(var b=a.length;b--;)a[b].dispose()}},dispatchEvent:function(a){a.domain=this;for(var b=this.sources.concat(),c=b.length;c--;)b[c].dispatchEvent(a);this.events.dispatchEvent(a)},dispose:function(){for(this.disposeList(this.sources);this.container.children.length;)this.container.remove(this.container.children[0]);
|
||||
for(var a=THREE.SEA3D.EXTENSIONS_DOMAIN.length;a--;){var b=THREE.SEA3D.EXTENSIONS_DOMAIN[a];b.dispose&&b.dispose.call(this)}this.disposeList(this.materials);this.disposeList(this.dummys);this.dispatchEvent({type:"dispose"})}});THREE.SEA3D.DomainManager=function(a){this.domains=[];this.autoDisposeRootDomain=void 0==a?!0:!1};
|
||||
Object.assign(THREE.SEA3D.DomainManager.prototype,{onDisposeDomain:function(a){this.remove(a.domain);this.autoDisposeRootDomain&&1==this.domains.length&&this.dispose()},add:function(a){this._onDisposeDomain=this._onDisposeDomain||this.onDisposeDomain.bind(this);a.on("dispose",this._onDisposeDomain);this.domains.push(a);this.textures=this.textures||a.textures;this.cubemaps=this.cubemaps||a.cubemaps;this.geometries=this.geometries||a.geometries},remove:function(a){a.removeEvent("dispose",this._onDisposeDomain);
|
||||
this.domains.splice(this.domains.indexOf(a),1)},contains:function(a){return-1!=this.domains.indexOf(a)},disposeList:function(a){if(a&&a.length){a=a.concat();for(var b=a.length;b--;)a[b].dispose()}},dispose:function(){this.disposeList(this.domains);this.disposeList(this.textures);this.disposeList(this.cubemaps);this.disposeList(this.geometries)}});
|
||||
THREE.SEA3D.ScriptDomain=function(a,b){a=a||new THREE.SEA3D.Domain;a.add(this);var c=new THREE.EventDispatcher;this.getId=function(){return a.id};this.isRoot=function(){return b};this.addEventListener=function(a,b){c.addEventListener(a,b)};this.hasEventListener=function(a,b){return c.hasEventListener(a,b)};this.removeEventListener=function(a,b){c.removeEventListener(a,b)};this.dispatchEvent=function(a){a.script=this;c.dispatchEvent(a)};this.dispose=function(){a.remove(this);b&&a.dispose();this.dispatchEvent({type:"dispose"})}};
|
||||
THREE.SEA3D.ScriptManager=function(){this.scripts=[];var a=function(a){this.remove(a.script)}.bind(this);this.add=function(b){b.addEventListener("dispose",a);this.scripts.push(b)};this.remove=function(b){b.removeEventListener("dispose",a);this.scripts.splice(this.scripts.indexOf(b),1)};this.contains=function(a){return-1<this.scripts.indexOf(a)};this.dispatchEvent=function(a){for(var c=this.scripts.concat(),d=c.length;d--;)c[d].dispatchEvent(a)}};THREE.SEA3D.ScriptHandler=new THREE.SEA3D.ScriptManager;
|
||||
THREE.SEA3D.ScriptHandler.dispatchUpdate=function(a){this.dispatchEvent({type:"update",delta:a})};THREE.SEA3D.Animator=function(a,b){this.clips=a;this.updateAnimations(b)};
|
||||
Object.assign(THREE.SEA3D.Animator.prototype,{update:function(a){this.mixer.update(a||0);if(this.currentAnimationAction.paused&&(this.pause(),this.currentAnimationData.onComplete))this.currentAnimationData.onComplete(this);return this},updateAnimations:function(a){this.playing&&this.stop();this.mixer&&THREE.SEA3D.AnimationHandler.removeAnimator(this);this.mixer=a;this.playing=this.relative=!1;this.timeScale=1;this.animations=[];this.animationsData={};this.clips=this instanceof THREE.SEA3D.Animator?
|
||||
this.clips:this.geometry.animations;a=0;for(var b=this.clips;a<b.length;a++){var c=b[a].name;this.animations[c]=this.animations[a]=b[a];this.animationsData[c]=this.animationsData[a]={}}},getStateByName:function(a){return this.animations.indexOf(this.animations[a])},getStateNameByIndex:function(a){return this.animations[a].name},pause:function(){this.playing&&this.currentAnimation&&(THREE.SEA3D.AnimationHandler.removeAnimator(this),this.playing=!1)},resume:function(){!this.playing&&this.currentAnimation&&
|
||||
(THREE.SEA3D.AnimationHandler.addAnimator(this),this.playing=!0);return this},setTimeScale:function(a){this.timeScale=a;this.currentAnimationAction&&this.updateTimeScale()},getTimeScale:function(){return this.timeScale},updateTimeScale:function(){this.currentAnimationAction.setEffectiveTimeScale(this.timeScale*(this.currentAnimation?this.currentAnimation.timeScale:1))},play:function(a,b,c,d){var e=this.animations[a];if(e==this.currentAnimation)return void 0===c&&e.loop||(this.currentAnimationAction.time=
|
||||
void 0!==c?c:0<=this.currentAnimationAction.timeScale?0:this.currentAnimation.duration),this.currentAnimationAction.setEffectiveWeight(void 0!==d?d:1),this.currentAnimationAction.paused=!1,this.resume();if(!e)throw Error('Animation "'+a+'" not found.');this.previousAnimation=this.currentAnimation;this.currentAnimation=e;this.previousAnimationAction=this.currentAnimationAction;this.currentAnimationAction=this.mixer.clipAction(e).setLoop(e.loop?THREE.LoopRepeat:THREE.LoopOnce,Infinity).reset();this.currentAnimationAction.clampWhenFinished=
|
||||
!e.loop;this.currentAnimationAction.paused=!1;this.previousAnimationData=this.currentAnimationData;this.currentAnimationData=this.animationsData[a];this.updateTimeScale();void 0===c&&e.loop||(this.currentAnimationAction.time=void 0!==c?c:0<=this.currentAnimationAction.timeScale?0:this.currentAnimation.duration);this.currentAnimationAction.setEffectiveWeight(void 0!==d?d:1);this.currentAnimationAction.play();this.playing||this.mixer.update(0);this.playing=!0;this.previousAnimation&&this.previousAnimationAction.crossFadeTo(this.currentAnimationAction,
|
||||
b||0,!0);THREE.SEA3D.AnimationHandler.addAnimator(this);return this},stop:function(){this.currentAnimation&&(this.currentAnimationAction.stop(),THREE.SEA3D.AnimationHandler.removeAnimator(this),this.previousAnimation=this.currentAnimation,this.previousAnimationData=this.currentAnimationData,this.previousAnimationAction=this.currentAnimationAction,delete this.currentAnimationAction,delete this.currentAnimationData,delete this.currentAnimation,this.playing=!1);return this},setRelative:function(a){this.relative!=
|
||||
a&&(this.stop(),this.relative=a)},getRelative:function(){return this.relative}});THREE.SEA3D.Object3DAnimator=function(a,b){this.object3d=b;THREE.SEA3D.Animator.call(this,a,new THREE.AnimationMixer(b))};
|
||||
THREE.SEA3D.Object3DAnimator.prototype=Object.assign(Object.create(THREE.SEA3D.Animator.prototype),{constructor:THREE.SEA3D.Object3DAnimator,stop:function(){if(this.currentAnimation){var a=this.object3d.animate;a&&this instanceof THREE.SEA3D.Object3DAnimator&&(a.position.set(0,0,0),a.quaternion.set(0,0,0,1),a.scale.set(1,1,1))}THREE.SEA3D.Animator.prototype.stop.call(this)},setRelative:function(a){THREE.SEA3D.Animator.prototype.setRelative.call(this,a);this.object3d.setAnimator(this.relative);this.updateAnimations(new THREE.AnimationMixer(this.relative?
|
||||
this.object3d.animate:this.object3d))}});THREE.SEA3D.CameraAnimator=function(a,b){THREE.SEA3D.Object3DAnimator.call(this,a,b)};THREE.SEA3D.CameraAnimator.prototype=Object.assign(Object.create(THREE.SEA3D.Object3DAnimator.prototype),{constructor:THREE.SEA3D.CameraAnimator});THREE.SEA3D.SoundAnimator=function(a,b){THREE.SEA3D.Object3DAnimator.call(this,a,b)};THREE.SEA3D.SoundAnimator.prototype=Object.assign(Object.create(THREE.SEA3D.Object3DAnimator.prototype),{constructor:THREE.SEA3D.SoundAnimator});
|
||||
THREE.SEA3D.LightAnimator=function(a,b){THREE.SEA3D.Object3DAnimator.call(this,a,b)};THREE.SEA3D.LightAnimator.prototype=Object.assign(Object.create(THREE.SEA3D.Object3DAnimator.prototype),{constructor:THREE.SEA3D.LightAnimator});THREE.SEA3D.Object3D=function(){THREE.Object3D.call(this)};
|
||||
THREE.SEA3D.Object3D.prototype=Object.assign(Object.create(THREE.Object3D.prototype),{constructor:THREE.SEA3D.Object3D,updateAnimateMatrix:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.animate.updateMatrix(),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.animate.matrix),this.matrixWorldNeedsUpdate=!1,a=
|
||||
!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},setAnimator:function(a){this.getAnimator()!=a&&(a?(this.animate=new THREE.Object3D,this.updateMatrixWorld=THREE.SEA3D.Object3D.prototype.updateAnimateMatrix):(delete this.animate,this.updateMatrixWorld=THREE.Object3D.prototype.updateMatrixWorld),this.matrixWorldNeedsUpdate=!0)},getAnimator:function(){return void 0!=this.animate}});THREE.SEA3D.HELPER_COLOR=10140133;
|
||||
THREE.SEA3D.Dummy=function(a,b,c){this.width=void 0!=a?a:100;this.height=void 0!=b?b:100;this.depth=void 0!=c?c:100;a=new THREE.BoxGeometry(this.width,this.height,this.depth,1,1,1);a.computeBoundingBox();a.computeBoundingSphere();THREE.Mesh.call(this,a,THREE.SEA3D.Dummy.MATERIAL)};THREE.SEA3D.Dummy.MATERIAL=new THREE.MeshBasicMaterial({wireframe:!0,color:THREE.SEA3D.HELPER_COLOR});
|
||||
THREE.SEA3D.Dummy.prototype=Object.assign(Object.create(THREE.Mesh.prototype),THREE.SEA3D.Object3D.prototype,{constructor:THREE.SEA3D.Dummy,copy:function(a){THREE.Mesh.prototype.copy.call(this,a);this.attribs=a.attribs;this.scripts=a.scripts;this.animator&&(this.animator=a.animator.clone(this));return this},dispose:function(){this.geometry.dispose()}});THREE.SEA3D.Mesh=function(a,b){THREE.Mesh.call(this,a,b)};
|
||||
THREE.SEA3D.Mesh.prototype=Object.assign(Object.create(THREE.Mesh.prototype),THREE.SEA3D.Mesh.prototype,THREE.SEA3D.Object3D.prototype,{constructor:THREE.SEA3D.Mesh,setWeight:function(a,b){this.morphTargetInfluences[this.morphTargetDictionary[a]]=b},getWeight:function(a){return this.morphTargetInfluences[this.morphTargetDictionary[a]]},copy:function(a){THREE.Mesh.prototype.copy.call(this,a);this.attribs=a.attribs;this.scripts=a.scripts;this.animator&&(this.animator=a.animator.clone(this));return this}});
|
||||
THREE.SEA3D.SkinnedMesh=function(a,b,c){THREE.SkinnedMesh.call(this,a,b,c);this.updateAnimations(new THREE.AnimationMixer(this))};
|
||||
THREE.SEA3D.SkinnedMesh.prototype=Object.assign(Object.create(THREE.SkinnedMesh.prototype),THREE.SEA3D.Mesh.prototype,THREE.SEA3D.Animator.prototype,{constructor:THREE.SEA3D.SkinnedMesh,boneByName:function(a){for(var b=this.skeleton.bones,c=0,d=b.length;c<d;c++)if(a==b[c].name)return b[c]},copy:function(a){THREE.SkinnedMesh.prototype.copy.call(this,a);this.attribs=a.attribs;this.scripts=a.scripts;this.animator&&(this.animator=a.animator.clone(this));return this}});
|
||||
THREE.SEA3D.VertexAnimationMesh=function(a,b){THREE.Mesh.call(this,a,b);this.type="MorphAnimMesh";this.updateAnimations(new THREE.AnimationMixer(this))};
|
||||
THREE.SEA3D.VertexAnimationMesh.prototype=Object.assign(Object.create(THREE.Mesh.prototype),THREE.SEA3D.Mesh.prototype,THREE.SEA3D.Animator.prototype,{constructor:THREE.SEA3D.VertexAnimationMesh,copy:function(a){THREE.Mesh.prototype.copy.call(this,a);this.attribs=a.attribs;this.scripts=a.scripts;this.animator&&(this.animator=a.animator.clone(this));return this}});THREE.SEA3D.Camera=function(a,b,c,d){THREE.PerspectiveCamera.call(this,a,b,c,d)};
|
||||
THREE.SEA3D.Camera.prototype=Object.assign(Object.create(THREE.PerspectiveCamera.prototype),THREE.SEA3D.Object3D.prototype,{constructor:THREE.SEA3D.Camera,copy:function(a){THREE.PerspectiveCamera.prototype.copy.call(this,a);this.attribs=a.attribs;this.scripts=a.scripts;this.animator&&(this.animator=a.animator.clone(this));return this}});THREE.SEA3D.OrthographicCamera=function(a,b,c,d,e,f){THREE.OrthographicCamera.call(this,a,b,c,d,e,f)};
|
||||
THREE.SEA3D.OrthographicCamera.prototype=Object.assign(Object.create(THREE.OrthographicCamera.prototype),THREE.SEA3D.Object3D.prototype,{constructor:THREE.SEA3D.OrthographicCamera,copy:function(a){THREE.OrthographicCamera.prototype.copy.call(this,a);this.attribs=a.attribs;this.scripts=a.scripts;this.animator&&(this.animator=a.animator.clone(this));return this}});THREE.SEA3D.PointLight=function(a,b,c,d){THREE.PointLight.call(this,a,b,c,d)};
|
||||
THREE.SEA3D.PointLight.prototype=Object.assign(Object.create(THREE.PointLight.prototype),THREE.SEA3D.Object3D.prototype,{constructor:THREE.SEA3D.PointLight,copy:function(a){THREE.PointLight.prototype.copy.call(this,a);this.attribs=a.attribs;this.scripts=a.scripts;this.animator&&(this.animator=a.animator.clone(this));return this}});THREE.SEA3D.PointSound=function(a){THREE.PositionalAudio.call(this,a)};
|
||||
THREE.SEA3D.PointSound.prototype=Object.assign(Object.create(THREE.PositionalAudio.prototype),THREE.SEA3D.Object3D.prototype,{constructor:THREE.SEA3D.PointSound,copy:function(a){THREE.PositionalAudio.prototype.copy.call(this,a);this.attribs=a.attribs;this.scripts=a.scripts;this.animator&&(this.animator=a.animator.clone(this));return this}});
|
||||
THREE.SEA3D.AnimationHandler={animators:[],update:function(a){for(var b=0;b<this.animators.length;)this.animators[b++].update(a)},addAnimator:function(a){-1===this.animators.indexOf(a)&&this.animators.push(a)},removeAnimator:function(a){a=this.animators.indexOf(a);-1!==a&&this.animators.splice(a,1)}};THREE.SEA3D.MTXBUF=new THREE.Matrix4;THREE.SEA3D.VECBUF=new THREE.Vector3;THREE.SEA3D.QUABUF=new THREE.Quaternion;THREE.SEA3D.BACKGROUND_COLOR=3355443;THREE.SEA3D.RTT_SIZE=512;
|
||||
THREE.SEA3D.prototype.setShadowMap=function(a){a.shadow.mapSize.width=2048;a.shadow.mapSize.height=1024;a.castShadow=!0;a.shadow.camera.left=-200;a.shadow.camera.right=200;a.shadow.camera.top=200;a.shadow.camera.bottom=-200;a.shadow.camera.near=1;a.shadow.camera.far=3E3;a.shadow.camera.fov=45;a.shadow.bias=-0.001};THREE.SEA3D.Domain.prototype.getMesh=THREE.SEA3D.prototype.getMesh=function(a){return this.objects["m3d/"+a]};
|
||||
THREE.SEA3D.Domain.prototype.getDummy=THREE.SEA3D.prototype.getDummy=function(a){return this.objects["dmy/"+a]};THREE.SEA3D.Domain.prototype.getLine=THREE.SEA3D.prototype.getLine=function(a){return this.objects["line/"+a]};THREE.SEA3D.Domain.prototype.getSound3D=THREE.SEA3D.prototype.getSound3D=function(a){return this.objects["sn3d/"+a]};THREE.SEA3D.Domain.prototype.getMaterial=THREE.SEA3D.prototype.getMaterial=function(a){return this.objects["mat/"+a]};
|
||||
THREE.SEA3D.Domain.prototype.getLight=THREE.SEA3D.prototype.getLight=function(a){return this.objects["lht/"+a]};THREE.SEA3D.Domain.prototype.getGLSL=THREE.SEA3D.prototype.getGLSL=function(a){return this.objects["glsl/"+a]};THREE.SEA3D.Domain.prototype.getCamera=THREE.SEA3D.prototype.getCamera=function(a){return this.objects["cam/"+a]};THREE.SEA3D.Domain.prototype.getTexture=THREE.SEA3D.prototype.getTexture=function(a){return this.objects["tex/"+a]};
|
||||
THREE.SEA3D.Domain.prototype.getCubeMap=THREE.SEA3D.prototype.getCubeMap=function(a){return this.objects["cmap/"+a]};THREE.SEA3D.Domain.prototype.getJointObject=THREE.SEA3D.prototype.getJointObject=function(a){return this.objects["jnt/"+a]};THREE.SEA3D.Domain.prototype.getContainer3D=THREE.SEA3D.prototype.getContainer3D=function(a){return this.objects["c3d/"+a]};THREE.SEA3D.Domain.prototype.getSprite=THREE.SEA3D.prototype.getSprite=function(a){return this.objects["m2d/"+a]};
|
||||
THREE.SEA3D.Domain.prototype.getProperties=THREE.SEA3D.prototype.getProperties=function(a){return this.objects["prop/"+a]};THREE.SEA3D.prototype.isPowerOfTwo=function(a){return a?(a&-a)==a:!1};THREE.SEA3D.prototype.nearestPowerOfTwo=function(a){return Math.pow(2,Math.round(Math.log(a)/Math.LN2))};
|
||||
THREE.SEA3D.prototype.updateTransform=function(a,b){var c=THREE.SEA3D.MTXBUF,d=THREE.SEA3D.VECBUF;b.transform?c.elements.set(b.transform):c.makeTranslation(b.position.x,b.position.y,b.position.z);a.position.setFromMatrixPosition(c);a.scale.setFromMatrixScale(c);c.scale(d.set(1/a.scale.x,1/a.scale.y,1/a.scale.z));a.rotation.setFromRotationMatrix(c);if(this.config.forceStatic||b.isStatic)a.updateMatrix(),a.matrixAutoUpdate=!1};
|
||||
THREE.SEA3D.prototype.toVector3=function(a){return new THREE.Vector3(a.x,a.y,a.z)};THREE.SEA3D.prototype.toFaces=function(a){var b=[];b[0]=a[1];b[1]=a[0];b[2]=a[3];b[3]=a[2];b[4]=a[5];b[5]=a[4];return b};THREE.SEA3D.prototype.updateScene=function(){if(void 0!=this.materials)for(var a=0,b=this.materials.length;a<b;++a)this.materials[a].needsUpdate=!0};
|
||||
THREE.SEA3D.prototype.addSceneObject=function(a){var b=a.tag;b.visible=a.visible;a.parent?a.parent.tag.add(b):this.config.container&&this.config.container.add(b);a.attributes&&(b.attribs=a.attributes.tag);a.scripts&&(b.scripts=this.getJSMList(b,a.scripts),this.config.runScripts&&this.domain.runJSMList(b))};THREE.SEA3D.prototype.createObjectURL=function(a,b){return(window.URL||window.webkitURL).createObjectURL(new Blob([a],{type:b}))};
|
||||
THREE.SEA3D.prototype.bufferToTexture=function(a){return this.createObjectURL(a,"image")};THREE.SEA3D.prototype.bufferToSound=function(a){return this.createObjectURL(a,"audio")};THREE.SEA3D.prototype.parsePath=function(a){var b=this.config.paths,c;for(c in b)a=a.replace(RegExp("%"+c+"%","g"),b[c]);return a};
|
||||
THREE.SEA3D.prototype.applyDefaultAnimation=function(a,b){for(var c=a.tag,d=0,e=a.animations?a.animations.length:0;d<e;d++){var f=a.animations[d];switch(f.tag.type){case SEA3D.Animation.prototype.type:return c.animator=new b(f.tag.tag,c),c.animator.setRelative(f.relative),this.config.autoPlay&&c.animator.play(0),c.animator}}};
|
||||
THREE.SEA3D.prototype.readAnimation=function(a){for(var b=[],c=1E3/a.frameRate/1E3,d=0;d<a.sequence.length;d++){for(var e=a.sequence[d],f=[],h=0;h<a.dataList.length;h++){var g=a.dataList[h],k,n=g.data,l=e.start*g.blockSize;k=l+e.count*g.blockSize;var s=e.intrpl?THREE.InterpolateLinear:!1,p=null;switch(g.kind){case SEA3D.Animation.POSITION:p=".position";break;case SEA3D.Animation.ROTATION:p=".quaternion";break;case SEA3D.Animation.SCALE:p=".scale";break;case SEA3D.Animation.COLOR:p=".color";break;
|
||||
case SEA3D.Animation.MULTIPLIER:p=".intensity";break;case SEA3D.Animation.FOV:p=".fov"}if(p)switch(g.type){case SEA3D.Stream.BYTE:case SEA3D.Stream.UBYTE:case SEA3D.Stream.INT:case SEA3D.Stream.UINT:case SEA3D.Stream.FLOAT:case SEA3D.Stream.DOUBLE:case SEA3D.Stream.DECIMAL:l=n.subarray(l,k);k=new Float32Array(l.length);for(var q=0,g=0;q<k.length;q++)k[q]=g,g+=c;f.push(new THREE.VectorKeyframeTrack(p,k,l,s));break;case SEA3D.Stream.VECTOR3D:l=n.subarray(l,k);k=new Float32Array(l.length/g.blockSize);
|
||||
for(g=q=0;q<k.length;q++)k[q]=g,g+=c;f.push(new THREE.VectorKeyframeTrack(p,k,l,s));break;case SEA3D.Stream.VECTOR4D:l=n.subarray(l,k);k=new Float32Array(l.length/g.blockSize);for(g=q=0;q<k.length;q++)k[q]=g,g+=c;f.push(new THREE.QuaternionKeyframeTrack(p,k,l,s));break;case SEA3D.Stream.INT24:case SEA3D.Stream.UINT24:l=new Float32Array(3*(k-l));k=new Float32Array(l.length/3);for(g=q=0;q<k.length;q++)l[3*q]=(n[q]>>16&255)/255,l[3*q+1]=(n[q]>>8&255)/255,l[3*q+2]=(n[q]&255)/255,k[q]=g,g+=c;f.push(new THREE.VectorKeyframeTrack(p,
|
||||
k,l,s))}}f=new THREE.AnimationClip(e.name,-1,f);f.loop=e.repeat;f.timeScale=1;b.push(f)}this.domain.animationClips=this.animationClips=this.animationClips||[];this.animationClips.push(this.objects[a.name+".#anm"]=a.tag=b)};
|
||||
THREE.SEA3D.prototype.readGeometryBuffer=function(a){for(var b=new THREE.BufferGeometry,c=0;c<a.groups.length;c++){var d=a.groups[c];b.addGroup(d.start,d.count,c)}b.setIndex(new THREE.BufferAttribute(a.indexes,1));b.addAttribute("position",new THREE.BufferAttribute(a.vertex,3));a.uv&&(b.addAttribute("uv",new THREE.BufferAttribute(a.uv[0],2)),1<a.uv.length&&b.addAttribute("uv2",new THREE.BufferAttribute(a.uv[1],2)));a.normal?b.addAttribute("normal",new THREE.BufferAttribute(a.normal,3)):b.computeVertexNormals();
|
||||
a.tangent4&&b.addAttribute("tangent",new THREE.BufferAttribute(a.tangent4,4));a.color&&b.addAttribute("color",new THREE.BufferAttribute(a.color[0],a.numColor));a.joint&&(b.addAttribute("skinIndex",new THREE.Float32Attribute(a.joint,a.jointPerVertex)),b.addAttribute("skinWeight",new THREE.Float32Attribute(a.weight,a.jointPerVertex)));this.config.bounding&&(b.computeBoundingBox(),b.computeBoundingSphere());b.name=a.name;this.domain.geometries=this.geometries=this.geometries||[];this.geometries.push(this.objects["geo/"+
|
||||
a.name]=a.tag=b)};THREE.SEA3D.prototype.readDummy=function(a){var b=new THREE.SEA3D.Dummy(a.width,a.height,a.depth);b.name=a.name;this.domain.dummys=this.dummys=this.dummys||[];this.dummys.push(this.objects["dmy/"+a.name]=a.tag=b);this.addSceneObject(a);this.updateTransform(b,a);this.applyDefaultAnimation(a,THREE.SEA3D.Object3DAnimator)};
|
||||
THREE.SEA3D.prototype.readLine=function(a){var b=new THREE.BufferGeometry;a.closed&&a.vertex.push(a.vertex[0],a.vertex[1],a.vertex[2]);b.addAttribute("position",new THREE.BufferAttribute(new Float32Array(a.vertex),3));b=new THREE.Line(b,new THREE.LineBasicMaterial({color:THREE.SEA3D.HELPER_COLOR,linewidth:3}));b.name=a.name;this.lines=this.lines||[];this.lines.push(this.objects["line/"+a.name]=a.tag=b);this.addSceneObject(a);this.updateTransform(b,a);this.applyDefaultAnimation(a,THREE.SEA3D.Object3DAnimator)};
|
||||
THREE.SEA3D.prototype.readContainer3D=function(a){var b=new THREE.SEA3D.Object3D;this.domain.containers=this.containers=this.containers||[];this.containers.push(this.objects["c3d/"+a.name]=a.tag=b);this.addSceneObject(a);this.updateTransform(b,a);this.applyDefaultAnimation(a,THREE.SEA3D.Object3DAnimator)};
|
||||
THREE.SEA3D.prototype.readSprite=function(a){var b;a.material&&(a.material.tag.sprite?b=a.material.tag.sprite:(b=a.material.tag.sprite=new THREE.SpriteMaterial,this.setBlending(b,a.blendMode),b.map=a.material.tag.map,b.map.flipY=!0,b.color.set(a.material.tag.color),b.opacity=a.material.tag.opacity,b.blending=a.material.tag.blending,b.fog=a.material.receiveFog));b=new THREE.Sprite(b);b.name=a.name;this.domain.sprites=this.sprites=this.sprites||[];this.sprites.push(this.objects["m2d/"+a.name]=a.tag=
|
||||
b);this.addSceneObject(a);this.updateTransform(b,a);b.scale.set(a.width,a.height,1)};
|
||||
THREE.SEA3D.prototype.readMesh=function(a){var b,c,d=a.geometry.tag,e,f,h,g,k;b=0;for(c=a.modifiers?a.modifiers.length:0;b<c;b++){var n=a.modifiers[b];switch(n.type){case SEA3D.Skeleton.prototype.type:case SEA3D.SkeletonLocal.prototype.type:f=n;d.bones=f.tag;break;case SEA3D.Morph.prototype.type:k=n,d.morphAttributes=k.tag.attribs,d.morphTargets=k.tag.targets}}b=0;for(c=a.animations?a.animations.length:0;b<c;b++)switch(n=a.animations[b],n.tag.type){case SEA3D.SkeletonAnimation.prototype.type:h=n.tag;
|
||||
d.animations=this.getSkeletonAnimation(h,f);break;case SEA3D.VertexAnimation.prototype.type:g=n.tag,d.morphAttributes=g.tag.attribs,d.morphTargets=g.tag.targets,d.animations=g.tag.animations}c=void 0!=k||void 0!=g;k=k&&void 0!=k.tag.attribs.normal||g&&void 0!=g.tag.attribs.normal;if(a.material)if(1<a.material.length){e=[];for(b=0;b<a.material.length;b++)e[b]=a.material[b].tag,e[b].skinning=void 0!=f,e[b].morphTargets=c,e[b].morphNormals=k,e[b].vertexColors=a.geometry.color?THREE.VertexColors:THREE.NoColors;
|
||||
e=new THREE.MultiMaterial(e)}else e=a.material[0].tag,e.skinning=void 0!=f,e.morphTargets=c,e.morphNormals=k,e.vertexColors=a.geometry.color?THREE.VertexColors:THREE.NoColors;f?(b=new THREE.SEA3D.SkinnedMesh(d,e,this.config.useVertexTexture),this.config.autoPlay&&h&&b.play(0)):g?(b=new THREE.SEA3D.VertexAnimationMesh(d,e,g.frameRate),this.config.autoPlay&&b.play(0)):b=new THREE.SEA3D.Mesh(d,e);b.name=a.name;b.castShadow=a.castShadows;b.receiveShadow=a.material?a.material[0].receiveShadows:!0;this.domain.meshes=
|
||||
this.meshes=this.meshes||[];this.meshes.push(this.objects["m3d/"+a.name]=a.tag=b);this.addSceneObject(a);this.updateTransform(b,a);this.applyDefaultAnimation(a,THREE.SEA3D.Object3DAnimator)};
|
||||
THREE.SEA3D.prototype.readSoundPoint=function(a){this.audioListener||(this.audioListener=new THREE.AudioListener,this.config.container&&this.config.container.add(this.audioListener));var b=new THREE.SEA3D.PointSound(this.audioListener);(new THREE.AudioLoader).load(a.sound.tag,function(a){b.setBuffer(a)});b.autoplay=a.autoPlay;b.setLoop(a.autoPlay);b.setVolume(a.volume);b.setRefDistance(a.distance);b.setRolloffFactor(this.config.audioRolloffFactor);b.name=a.name;this.domain.sounds3d=this.sounds3d=
|
||||
this.sounds3d||[];this.sounds3d.push(this.objects["sn3d/"+a.name]=a.tag=b);this.addSceneObject(a);this.updateTransform(b,a);this.applyDefaultAnimation(a,THREE.SEA3D.SoundAnimator)};
|
||||
THREE.SEA3D.prototype.readCubeRender=function(a){var b=new THREE.CubeCamera(0.1,5E3,THREE.SEA3D.RTT_SIZE);b.renderTarget.cubeCamera=b;this.domain.cubeRenderers=this.cubeRenderers=this.cubeRenderers||[];this.cubeRenderers.push(this.objects["rttc/"+a.name]=a.tag=b.renderTarget);this.addSceneObject(a);this.updateTransform(b,a);this.applyDefaultAnimation(a,THREE.SEA3D.Object3DAnimator)};
|
||||
THREE.SEA3D.prototype.readTexture=function(a){var b=new Image,c=new THREE.Texture;c.name=a.name;c.wrapS=c.wrapT=THREE.RepeatWrapping;c.flipY=!1;c.image=b;void 0!==this.config.anisotropy&&(c.anisotropy=this.config.anisotropy);b.onload=function(){c.needsUpdate=!0};b.src=this.bufferToTexture(a.data.buffer);this.domain.textures=this.textures=this.textures||[];this.textures.push(this.objects["tex/"+a.name]=a.tag=c)};
|
||||
THREE.SEA3D.prototype.readCubeMap=function(a){var b=this.toFaces(a.faces),c=new THREE.CubeTexture([]),d=0;c.name=a.name;c.flipY=!1;c.format=THREE.RGBFormat;for(var e=function(){6==++d&&(c.needsUpdate=!0,this.config.async||(this.file.resume=!0))}.bind(this),f=0;f<b.length;++f){var h=new Image;h.onload=e;h.src=this.bufferToTexture(b[f].buffer);c.images[f]=h}this.config.async||(this.file.resume=!1);this.domain.cubemaps=this.cubemaps=this.cubemaps||[];this.cubemaps.push(this.objects["cmap/"+a.name]=a.tag=
|
||||
c)};THREE.SEA3D.prototype.readSound=function(a){var b=this.bufferToSound(a.data.buffer);this.domain.sounds=this.sounds=this.sounds||[];this.sounds.push(this.objects["snd/"+a.name]=a.tag=b)};THREE.SEA3D.prototype.readScriptURL=function(a){this.file.resume=!1;this.request(a.url,function(b){this.file.resume=!0;this.domain.scripts=this.scripts=this.scripts||[];this.scripts.push(this.objects["src/"+a.name]=a.tag=b)}.bind(this))};
|
||||
THREE.SEA3D.prototype.readTextureURL=function(a){var b=(new THREE.TextureLoader).load(this.parsePath(a.url));b.name=a.name;b.wrapS=b.wrapT=THREE.RepeatWrapping;b.flipY=!1;void 0!==this.config.anisotropy&&(b.anisotropy=this.config.anisotropy);this.domain.textures=this.textures=this.textures||[];this.textures.push(this.objects["tex/"+a.name]=a.tag=b)};
|
||||
THREE.SEA3D.prototype.readCubeMapURL=function(a){for(var b=this.toFaces(a.faces),c=0;c<b.length;c++)b[c]=this.parsePath(b[c]);if("hdr"==b[0].substr(-3)){var d=null!=THREE.PMREMGenerator;this.file.resume=!d;b=(new THREE.HDRCubeTextureLoader).load(THREE.UnsignedByteType,b,function(b){if(d){var c=new THREE.PMREMGenerator(b);c.update(this.config.renderer);c=new THREE.PMREMCubeUVPacker(c.cubeLods);c.update(this.config.renderer);b.dispose();this.objects["cmap/"+a.name]=a.tag=c.CubeUVRenderTarget.texture;
|
||||
this.file.resume=!0}}.bind(this))}else b=(new THREE.CubeTextureLoader).load(b);b.name=a.name;b.wrapS=b.wrapT=THREE.RepeatWrapping;b.flipY=!1;void 0!==this.config.anisotropy&&(b.anisotropy=this.config.anisotropy);this.domain.cubemaps=this.cubemaps=this.cubemaps||[];this.cubemaps.push(this.objects["cmap/"+a.name]=a.tag=b)};
|
||||
THREE.SEA3D.prototype.getJSMList=function(a,b){for(var c=[],d=0;d<b.length;d++){var e=b[d];e.tag.type==SEA3D.JavaScriptMethod.prototype.type&&c.push(e)}this.domain.scriptTargets=this.scriptTargets=this.scriptTargets||[];this.scriptTargets.push(a);return c};
|
||||
THREE.SEA3D.prototype.readJavaScriptMethod=function(a){try{var b="(function() {\nvar $METHOD = {}\n",c='function($INC, $REF, global, local, $his, $PARAM) {\nvar watch = $INC["watch"],\nscene = $INC["scene"],\nsea3d = $INC["sea3d"],\nprint = $INC["print"];\n',c=c+'var $SRC = $INC["source"],\naddEventListener = $SRC.addEventListener.bind( $SRC ),\nhasEventListener = $SRC.hasEventListener.bind( $SRC ),\nremoveEventListener = $SRC.removeEventListener.bind( $SRC ),\ndispatchEvent = $SRC.dispatchEvent.bind( $SRC ),\ndispose = $SRC.dispose.bind( $SRC );\n',
|
||||
d;for(d in a.methods)b+='$METHOD["'+d+'"] = '+c+a.methods[d].src+"}\n";this.domain.methods=eval(b+"return $METHOD; })")()}catch(e){console.error('SEA3D JavaScriptMethod: Error running "'+a.name+'".'),console.error(e)}};THREE.SEA3D.prototype.readGLSL=function(a){this.domain.glsl=this.glsl=this.glsl||[];this.glsl.push(this.objects["glsl/"+a.name]=a.tag=a.src)};
|
||||
THREE.SEA3D.prototype.materialTechnique=function(){var a={onComplete:function(a,c){if(1>c.alpha||a.blending>THREE.NormalBlending)a.opacity=c.alpha,a.transparent=!0}};a[SEA3D.Material.PHYSICAL]=function(a,c){a.color.setHex(c.color);a.roughness=c.roughness;a.metalness=c.metalness};a[SEA3D.Material.PHONG]=function(a,c){a.color.setHex(c.diffuseColor);a.specular.setHex(c.specularColor).multiplyScalar(c.specular);a.shininess=c.gloss};a[SEA3D.Material.DIFFUSE_MAP]=function(a,c,d){a.map=c.texture.tag;a.color.setHex(16777215);
|
||||
c.texture.transparent&&(a.transparent=!0)};a[SEA3D.Material.ROUGHNESS_MAP]=function(a,c){a.roughnessMap=c.texture.tag};a[SEA3D.Material.METALNESS_MAP]=function(a,c){a.metalnessMap=c.texture.tag};a[SEA3D.Material.SPECULAR_MAP]=function(a,c){a.specular&&(a.specularMap=c.texture.tag,a.specular.setHex(16777215))};a[SEA3D.Material.NORMAL_MAP]=function(a,c){a.normalMap=c.texture.tag};a[SEA3D.Material.REFLECTION]=a[SEA3D.Material.FRESNEL_REFLECTION]=function(a,c){a.envMap=c.texture.tag;a.envMap.mapping=
|
||||
THREE.CubeReflectionMapping;a.combine=THREE.MixOperation;a.reflectivity=c.alpha};a[SEA3D.Material.REFLECTION_SPHERICAL]=function(a,c){a.envMap=c.texture.tag;a.envMap.mapping=THREE.SphericalReflectionMapping;a.combine=THREE.MixOperation;a.reflectivity=c.alpha};a[SEA3D.Material.REFRACTION_MAP]=function(a,c){a.envMap=c.texture.tag;a.envMap.mapping=THREE.CubeRefractionMapping;a.refractionRatio=c.ior;a.reflectivity=c.alpha};a[SEA3D.Material.LIGHT_MAP]=function(a,c){"multiply"==c.blendMode?a.aoMap=c.texture.tag:
|
||||
a.lightMap=c.texture.tag};a[SEA3D.Material.ALPHA_MAP]=function(a,c){a.alphaMap=c.texture.tag;a.transparent=!0};return a}();THREE.SEA3D.prototype.createMaterial=function(a){return a.physical?new THREE.MeshStandardMaterial:new THREE.MeshPhongMaterial};
|
||||
THREE.SEA3D.prototype.setBlending=function(a,b){if("normal"!=b){switch(b){case "add":a.blending=THREE.AdditiveBlending;break;case "subtract":a.blending=THREE.SubtractiveBlending;break;case "multiply":a.blending=THREE.MultiplyBlending;break;case "screen":a.blending=THREE.CustomBlending,a.blendSrc=THREE.OneFactor,a.blendDst=THREE.OneMinusSrcColorFactor,a.blendEquation=THREE.AddEquation}a.transparent=!0}};
|
||||
THREE.SEA3D.prototype.readMaterial=function(a){var b=this.createMaterial(a);b.name=a.name;b.premultipliedAlpha=this.config.premultipliedAlpha;b.side=a.bothSides?THREE.DoubleSide:THREE.FrontSide;this.setBlending(b,a.blendMode);for(var c=0;c<a.technique.length;c++){var d=a.technique[c];this.materialTechnique[d.kind]&&this.materialTechnique[d.kind].call(this,b,d,a)}this.materialTechnique.onComplete&&this.materialTechnique.onComplete.call(this,b,a);this.domain.materials=this.materials=this.materials||
|
||||
[];this.materials.push(this.objects["mat/"+a.name]=a.tag=b)};THREE.SEA3D.prototype.readPointLight=function(a){var b=new THREE.SEA3D.PointLight(a.color,a.multiplier*this.config.multiplier);b.name=a.name;a.attenuation&&(b.distance=a.attenuation.end);a.shadow&&this.setShadowMap(b);this.domain.lights=this.lights=this.lights||[];this.lights.push(this.objects["lht/"+a.name]=a.tag=b);this.addSceneObject(a);this.updateTransform(b,a);this.applyDefaultAnimation(a,THREE.SEA3D.LightAnimator);this.updateScene()};
|
||||
THREE.SEA3D.prototype.readHemisphereLight=function(a){var b=new THREE.HemisphereLight(a.color,a.secondColor,a.multiplier*this.config.multiplier);b.position.set(0,500,0);b.name=a.name;this.domain.lights=this.lights=this.lights||[];this.lights.push(this.objects["lht/"+a.name]=a.tag=b);this.addSceneObject(a);this.applyDefaultAnimation(a,THREE.SEA3D.LightAnimator);this.updateScene()};
|
||||
THREE.SEA3D.prototype.readAmbientLight=function(a){var b=new THREE.AmbientLight(a.color,a.multiplier*this.config.multiplier);b.name=a.name;this.domain.lights=this.lights=this.lights||[];this.lights.push(this.objects["lht/"+a.name]=a.tag=b);this.addSceneObject(a);this.applyDefaultAnimation(a,THREE.SEA3D.LightAnimator);this.updateScene()};
|
||||
THREE.SEA3D.prototype.readDirectionalLight=function(a){var b=new THREE.DirectionalLight(a.color,a.multiplier*this.config.multiplier);b.name=a.name;a.shadow&&this.setShadowMap(b);this.domain.lights=this.lights=this.lights||[];this.lights.push(this.objects["lht/"+a.name]=a.tag=b);this.addSceneObject(a);this.updateTransform(b,a);this.applyDefaultAnimation(a,THREE.SEA3D.LightAnimator);this.updateScene()};
|
||||
THREE.SEA3D.prototype.readCamera=function(a){var b=new THREE.SEA3D.Camera(a.fov);b.name=a.name;this.domain.cameras=this.cameras=this.cameras||[];this.cameras.push(this.objects["cam/"+a.name]=a.tag=b);this.addSceneObject(a);this.updateTransform(b,a);this.applyDefaultAnimation(a,THREE.SEA3D.CameraAnimator)};
|
||||
THREE.SEA3D.prototype.readOrthographicCamera=function(a){var b,c;this.config.stageWidth>this.config.stageHeight?(b=this.config.stageWidth/this.config.stageHeight,c=a.height*b,b=a.height):(b=this.config.stageHeight/this.config.stageWidth,c=a.height,b*=a.height);c=new THREE.SEA3D.OrthographicCamera(-c,c,b,-b);c.name=a.name;this.domain.cameras=this.cameras=this.cameras||[];this.cameras.push(this.objects["cam/"+a.name]=a.tag=c);this.addSceneObject(a);this.updateTransform(c,a);this.applyDefaultAnimation(a,
|
||||
THREE.SEA3D.CameraAnimator)};THREE.SEA3D.prototype.readSkeletonLocal=function(a){for(var b=[],c=0;c<a.joint.length;c++){var d=a.joint[c];b[c]={name:d.name,pos:[d.x,d.y,d.z],rotq:[d.qx,d.qy,d.qz,d.qw],parent:d.parentIndex}}a.tag=b};THREE.SEA3D.prototype.readJointObject=function(a){var b=a.target.tag.skeleton.bones[a.joint];this.domain.joints=this.joints=this.joints||[];this.joints.push(this.objects["jnt/"+a.name]=a.tag=b)};
|
||||
THREE.SEA3D.prototype.readMorpher=function(a){for(var b={position:[]},c=[],d=0;d<a.node.length;d++){var e=a.node[d];b.position[d]=new THREE.Float32Attribute(new Float32Array(e.vertex),3);e.normal&&(b.normal=b.normal||[],b.normal[d]=new THREE.Float32Attribute(new Float32Array(e.normal),3));c[d]={name:e.name}}a.tag={attribs:b,targets:c}};
|
||||
THREE.SEA3D.prototype.getSkeletonAnimation=function(a,b){if(a.tag)return a.tag;for(var c=[],d=1E3/a.frameRate/1E3,e=0;e<a.sequence.length;e++){for(var f=a.sequence[e],h=f.start,g=h+f.count,k={name:f.name,fps:a.frameRate,length:d*f.count,hierarchy:[]},n=a.numJoints,l=a.raw,s=0;s<n;s++){for(var p={parent:b.joint[s].parentIndex,keys:[]},q=p.keys,t=0,r=h;r<g;r++){var m=r*n*7+7*s;q.push({time:t,pos:[l[m],l[m+1],l[m+2]],rot:[l[m+3],l[m+4],l[m+5],l[m+6]],scl:[1,1,1]});t+=d}k.hierarchy[s]=p}h=THREE.AnimationClip.parseAnimation(k,
|
||||
b.tag);h.loop=f.repeat;h.timeScale=1;c.push(h)}return a.tag=c};
|
||||
THREE.SEA3D.prototype.readVertexAnimation=function(a){var b={position:[]},c=[],d=[],e,f,h;e=0;for(h=a.frame.length;e<h;e++)f=a.frame[e],b.position[e]=new THREE.Float32Attribute(new Float32Array(f.vertex),3),f.normal&&(b.normal=b.normal||[],b.normal[e]=new THREE.Float32Attribute(new Float32Array(f.normal),3)),c[e]={name:e};for(e=0;e<a.sequence.length;e++){h=a.sequence[e];var g=[];for(f=0;f<h.count;f++)g[f]=c[h.start+f];f=THREE.AnimationClip.CreateFromMorphTargetSequence(h.name,g,a.frameRate);f.loop=
|
||||
h.repeat;f.timeScale=1;d.push(f)}a.tag={attribs:b,targets:c,animations:d}};
|
||||
THREE.SEA3D.prototype.readActions=function(a){for(var b=0;b<a.actions.length;b++){var c=a.actions[b];switch(c.kind){case SEA3D.Actions.ATTRIBUTES:this.attribs=this.domain.attribs=c.attributes.tag;break;case SEA3D.Actions.SCRIPTS:this.domain.scripts=this.getJSMList(this.domain,c.scripts);this.config.runScripts&&this.domain.runJSMList(this.domain);break;case SEA3D.Actions.ENVIRONMENT_COLOR:this.domain.background=this.background=this.background||{};this.background.color=new THREE.Color(c.color);break;
|
||||
case SEA3D.Actions.ENVIRONMENT:if(this.config.useEnvironment&&void 0!=this.materials)for(var d=0,e=this.materials.length;d<e;++d){var f=this.materials[d];f instanceof THREE.MeshStandardMaterial&&!f.envMap&&(f.envMap=c.texture.tag,f.envMap.mapping=THREE.CubeReflectionMapping,f.needsUpdate=!0)}this.domain.background=this.background=this.background||{};this.background.texture=c.texture.tag}}};
|
||||
THREE.SEA3D.Event={PROGRESS:"sea3d_progress",LOAD_PROGRESS:"sea3d_load",DOWNLOAD_PROGRESS:"sea3d_download",COMPLETE:"sea3d_complete",OBJECT_COMPLETE:"sea3d_object",PARSE_PROGRESS:"parse_progress",PARSE_COMPLETE:"parse_complete",ERROR:"sea3d_error"};THREE.SEA3D.prototype.onProgress=function(a){a.status=a.type;a.progress=a.loaded/a.total;a.type=THREE.SEA3D.Event.PROGRESS;this.dispatchEvent(a)};
|
||||
THREE.SEA3D.prototype.onLoadProgress=function(a){a.type=THREE.SEA3D.Event.LOAD_PROGRESS;this.dispatchEvent(a);this.onProgress(a)};THREE.SEA3D.prototype.onDownloadProgress=function(a){a.type=THREE.SEA3D.Event.DOWNLOAD_PROGRESS;this.dispatchEvent(a);this.onProgress(a)};THREE.SEA3D.prototype.onComplete=function(a){a.type=THREE.SEA3D.Event.COMPLETE;this.dispatchEvent(a)};THREE.SEA3D.prototype.onCompleteObject=function(a){a.type=THREE.SEA3D.Event.OBJECT_COMPLETE;this.dispatchEvent(a)};
|
||||
THREE.SEA3D.prototype.onParseProgress=function(a){a.type=THREE.SEA3D.Event.PARSE_PROGRESS;this.dispatchEvent(a)};THREE.SEA3D.prototype.onParseComplete=function(a){a.type=THREE.SEA3D.Event.PARSE_COMPLETE;this.dispatchEvent(a)};THREE.SEA3D.prototype.onError=function(a){a.type=THREE.SEA3D.Event.ERROR;this.dispatchEvent(a)};THREE.SEA3D.prototype.createDomain=function(){return this.domain=new THREE.SEA3D.Domain(this.config.id,this.objects={},this.config.container)};
|
||||
THREE.SEA3D.prototype.clone=function(a,b,c){if(!this.file.isDone())throw Error("Previous parse is not completed.");this.config.container=a&&void 0!==a.container?a.container:new THREE.Object3D;a&&this.loadConfig(a);var d=this.config.timeLimit;this.config.timeLimit=a&&void 0!==a.timeLimit?a.timeLimit:Infinity;this.parse(b,c);this.config.timeLimit=d;return this.domain};THREE.SEA3D.prototype.loadConfig=function(a){for(var b in a)this.config[b]=a[b]};
|
||||
THREE.SEA3D.prototype.parse=function(a,b){delete this.cameras;delete this.containers;delete this.lights;delete this.joints;delete this.meshes;delete this.materials;delete this.animationSets;delete this.sprites;delete this.sounds3d;delete this.cubeRenderers;delete this.sounds;delete this.glsl;delete this.dummy;delete this.domain;this.createDomain();this.setTypeRead();this.file.onParseComplete=function(b){this.config.manager&&this.config.manager.add(this.domain);(a||this.onParseComplete).call(this.file,
|
||||
b)}.bind(this);this.file.onParseProgress=b||this.onParseProgress;for(var c=THREE.SEA3D.EXTENSIONS_LOADER.length;c--;){var d=THREE.SEA3D.EXTENSIONS_LOADER[c];d.parse&&d.parse.call(this)}this.file.parse();return this.domain};THREE.SEA3D.prototype.onHead=function(a){if("TJS"!=a.sign)throw Error("Sign '"+a.sign+"' not supported! Use SEA3D Studio to publish or SEA3DLegacy.js");};THREE.SEA3D.EXTENSIONS_LOADER=[];THREE.SEA3D.EXTENSIONS_DOMAIN=[];
|
||||
THREE.SEA3D.prototype.setTypeRead=function(){this.file.typeRead={};this.file.typeRead[SEA3D.Geometry.prototype.type]=this.readGeometryBuffer;this.file.typeRead[SEA3D.Mesh.prototype.type]=this.readMesh;this.file.typeRead[SEA3D.Sprite.prototype.type]=this.readSprite;this.file.typeRead[SEA3D.Container3D.prototype.type]=this.readContainer3D;this.file.typeRead[SEA3D.Line.prototype.type]=this.readLine;this.file.typeRead[SEA3D.Material.prototype.type]=this.readMaterial;this.file.typeRead[SEA3D.Camera.prototype.type]=
|
||||
this.readCamera;this.file.typeRead[SEA3D.OrthographicCamera.prototype.type]=this.readOrthographicCamera;this.file.typeRead[SEA3D.SkeletonLocal.prototype.type]=this.readSkeletonLocal;this.file.typeRead[SEA3D.JointObject.prototype.type]=this.readJointObject;this.file.typeRead[SEA3D.CubeMap.prototype.type]=this.readCubeMap;this.file.typeRead[SEA3D.CubeRender.prototype.type]=this.readCubeRender;this.file.typeRead[SEA3D.Animation.prototype.type]=this.readAnimation;this.file.typeRead[SEA3D.SoundPoint.prototype.type]=
|
||||
this.readSoundPoint;this.file.typeRead[SEA3D.TextureURL.prototype.type]=this.readTextureURL;this.file.typeRead[SEA3D.CubeMapURL.prototype.type]=this.readCubeMapURL;this.file.typeRead[SEA3D.Morph.prototype.type]=this.readMorpher;this.file.typeRead[SEA3D.VertexAnimation.prototype.type]=this.readVertexAnimation;this.file.typeRead[SEA3D.Actions.prototype.type]=this.readActions;this.config.dummys&&(this.file.typeRead[SEA3D.Dummy.prototype.type]=this.readDummy);this.config.scripts&&(this.file.typeRead[SEA3D.ScriptURL.prototype.type]=
|
||||
this.readScriptURL,this.file.typeRead[SEA3D.JavaScriptMethod.prototype.type]=this.readJavaScriptMethod);this.config.lights&&(this.file.typeRead[SEA3D.PointLight.prototype.type]=this.readPointLight,this.file.typeRead[SEA3D.DirectionalLight.prototype.type]=this.readDirectionalLight,this.file.typeRead[SEA3D.HemisphereLight.prototype.type]=this.readHemisphereLight,this.file.typeRead[SEA3D.AmbientLight.prototype.type]=this.readAmbientLight);this.file.typeRead[SEA3D.JPEG.prototype.type]=this.file.typeRead[SEA3D.JPEG_XR.prototype.type]=
|
||||
this.file.typeRead[SEA3D.PNG.prototype.type]=this.file.typeRead[SEA3D.GIF.prototype.type]=this.readTexture;this.file.typeRead[SEA3D.MP3.prototype.type]=this.readSound;this.file.typeRead[SEA3D.GLSL.prototype.type]=this.readGLSL;for(var a=THREE.SEA3D.EXTENSIONS_LOADER.length;a--;){var b=THREE.SEA3D.EXTENSIONS_LOADER[a];b.setTypeRead&&b.setTypeRead.call(this)}};
|
||||
THREE.SEA3D.prototype.request=function(a,b,c){var d=new XMLHttpRequest;d.open("GET",a,!0);c&&(d.responseType=c);d.onreadystatechange=function(){4===d.readyState&&(200===d.status||0===d.status?b(this.response):console.error(1001,"Couldn't load ["+a+"] ["+d.status+"]"))};d.send()};
|
||||
THREE.SEA3D.prototype.load=function(a){this.file=new SEA3D.File;this.file.scope=this;this.file.config=this.config;this.file.onProgress=this.onLoadProgress.bind(this);this.file.onCompleteObject=this.onCompleteObject.bind(this);this.file.onDownloadProgress=this.onDownloadProgress.bind(this);this.file.onParseProgress=this.onParseProgress.bind(this);this.file.onParseComplete=this.onParseComplete.bind(this);this.file.onError=this.onError.bind(this);this.file.onHead=this.onHead.bind(this);this.file.onComplete=
|
||||
function(a){this.config.manager&&this.config.manager.add(this.domain);this.onComplete.call(this,a)}.bind(this);this.createDomain();this.setTypeRead();"string"==typeof a?this.file.load(a):this.file.read(a)};var THREE;THREE.SEA3D.prototype._onHead=THREE.SEA3D.prototype.onHead;THREE.SEA3D.prototype._updateTransform=THREE.SEA3D.prototype.updateTransform;THREE.SEA3D.prototype._readVertexAnimation=THREE.SEA3D.prototype.readVertexAnimation;THREE.SEA3D.prototype._readGeometryBuffer=THREE.SEA3D.prototype.readGeometryBuffer;THREE.SEA3D.prototype._readLine=THREE.SEA3D.prototype.readLine;THREE.SEA3D.prototype._getSkeletonAnimation=THREE.SEA3D.prototype.getSkeletonAnimation;
|
||||
THREE.SEA3D.prototype._applyDefaultAnimation=THREE.SEA3D.prototype.applyDefaultAnimation;THREE.SEA3D.prototype.isLegacy=function(a){var b=a.sea3d;return"S3D"!=b.sign||a._legacy?!1:(a._legacy=!0==b.typeUnique[a.type],b.config.legacy)};THREE.SEA3D.prototype.flipZVec3=function(a){if(a){for(var b=2;b<a.length;)a[b]=-a[b],b+=3;return a}};
|
||||
THREE.SEA3D.prototype.expandJoints=function(a){for(var b=4*a.numVertex,c=a.isBig?new Uint32Array(b):new Uint16Array(b),b=new Float32Array(b),d=0,e=a.jointPerVertex,f=0;f<a.numVertex;f++){var h=4*f,d=f*e;c[h]=a.joint[d];1<e&&(c[h+1]=a.joint[d+1]);2<e&&(c[h+2]=a.joint[d+2]);3<e&&(c[h+3]=a.joint[d+3]);b[h]=a.weight[d];1<e&&(b[h+1]=a.weight[d+1]);2<e&&(b[h+2]=a.weight[d+2]);3<e&&(b[h+3]=a.weight[d+3]);d=b[h]+b[h+1]+b[h+2]+b[h+3];b[h]+=1-d}a.joint=c;a.weight=b;a.jointPerVertex=4};
|
||||
THREE.SEA3D.prototype.compressJoints=function(a){for(var b=4*a.numVertex,c=a.isBig?new Uint32Array(b):new Uint16Array(b),b=new Float32Array(b),d=0,e=a.jointPerVertex,f=0;f<a.numVertex;f++){var h=4*f,d=f*e;c[h]=a.joint[d];c[h+1]=a.joint[d+1];c[h+2]=a.joint[d+2];c[h+3]=a.joint[d+3];b[h]=a.weight[d];b[h+1]=a.weight[d+1];b[h+2]=a.weight[d+2];b[h+3]=a.weight[d+3];d=b[h]+b[h+1]+b[h+2]+b[h+3];b[h]+=1-d}a.joint=c;a.weight=b;a.jointPerVertex=4};
|
||||
THREE.SEA3D.prototype.flipZIndex=function(a){for(var b=1;b<a.length;){var c=a[b+1];a[b+1]=a[b];a[b]=c;b+=3}return a};THREE.SEA3D.prototype.flipMatrixBone=function(a){var b=new THREE.Vector3,c=new THREE.Matrix4;return function(a){c.copy(a);a.setPosition(b);a.multiplyMatrices(THREE.SEA3D.MTXBUF.makeRotationZ(THREE.Math.degToRad(180)),a);a.makeRotationFromQuaternion(THREE.SEA3D.QUABUF.setFromRotationMatrix(a));var e=THREE.SEA3D.VECBUF.setFromMatrixPosition(c);e.z=-e.z;a.setPosition(e);return a}}();
|
||||
THREE.SEA3D.prototype.flipMatrixScale=function(a,b,c,d){var e=new THREE.Vector3,f=new THREE.Quaternion,h=new THREE.Vector3;return function(a,b,c,d){c&&a.multiplyMatrices(c,a);a.decompose(e,f,h);h.z=-h.z;b&&(h.y=-h.y,h.x=-h.x);a.compose(e,f,h);c&&(c=c.clone(),this.flipMatrixScale(c,d),a.multiplyMatrices(c.getInverse(c),a));return a}}();
|
||||
THREE.SEA3D.prototype.updateAnimationSet=function(a){var b=new THREE.Matrix4,c=new THREE.Matrix4,d=new THREE.Vector3,e=new THREE.Quaternion,f=new THREE.Vector3,h=new THREE.Vector3,g=new THREE.Quaternion,k=new THREE.Vector3;return function(a){var l=a.animation.animationSet,s=l.animations;if(!l.flip||s.length){for(var p=s[0].dataList,s=[],q=0;q<p.length;q++){var t=p[q],r=p[q].data,m=t.kind,t=r.length/t.blockLength;switch(m){case SEA3D.Animation.POSITION:case SEA3D.Animation.ROTATION:case SEA3D.Animation.SCALE:s.push({kind:m,
|
||||
numFrames:t,raw:r})}}if(0<s.length)for(t=s[0].numFrames,r=void 0,a.animation.relative?(b.identity(),this.flipMatrixScale(c.copy(a.matrixWorld))):(a.parent&&(r=this.flipMatrixScale(c.copy(a.parent.matrixWorld))),this.flipMatrixScale(b.copy(a.matrix),!1,r)),b.decompose(d,e,f),a=0;a<t;a++){for(p=0;p<s.length;p++)switch(r=s[p].raw,m=s[p].kind,m){case SEA3D.Animation.POSITION:m=3*a;d.set(r[m],r[m+1],r[m+2]);break;case SEA3D.Animation.ROTATION:m=4*a;e.set(r[m],r[m+1],r[m+2],r[m+3]);break;case SEA3D.Animation.SCALE:m=
|
||||
4*a,f.set(r[m],r[m+1],r[m+2])}b.compose(d,e,f);this.flipMatrixScale(b,!1,c);b.decompose(h,g,k);for(p=0;p<s.length;p++)switch(r=s[p].raw,m=s[p].kind,m){case SEA3D.Animation.POSITION:m=3*a;r[m]=h.x;r[m+1]=h.y;r[m+2]=h.z;break;case SEA3D.Animation.ROTATION:m=4*a;r[m]=g.x;r[m+1]=g.y;r[m+2]=g.z;r[m+3]=g.w;break;case SEA3D.Animation.SCALE:m=3*a,r[m]=k.x,r[m+1]=k.y,r[m+2]=k.z}}l.flip=!0}}}();
|
||||
THREE.SEA3D.prototype.applyDefaultAnimation=function(a,b){this._applyDefaultAnimation(a,b);this.isLegacy(a)&&a.tag.animation&&this.updateAnimationSet(a.tag)};
|
||||
THREE.SEA3D.prototype.updateTransform=function(a,b){var c=new THREE.Matrix4,d=new THREE.Matrix4;return function(a,b){this.isLegacy(b)?(b.transform?c.elements.set(b.transform):c.makeTranslation(b.position.x,b.position.y,b.position.z),this.flipMatrixScale(c,!1,a.parent?a.parent.matrixWorld:d,a.parent instanceof THREE.Bone),a.position.setFromMatrixPosition(c),a.scale.setFromMatrixScale(c),c.scale(THREE.SEA3D.VECBUF.set(1/a.scale.x,1/a.scale.y,1/a.scale.z)),a.rotation.setFromRotationMatrix(c),a.updateMatrixWorld()):
|
||||
this._updateTransform(a,b)}}();
|
||||
THREE.SEA3D.prototype.readSkeleton=function(a){var b=new THREE.Matrix4,c=new THREE.Matrix4,d=new THREE.Matrix4,e=new THREE.Vector3,f=new THREE.Quaternion;return function(a){for(var g=[],k=a.sea3d.config.legacy,n=0;n<a.joint.length;n++){var l=a.joint[n];b.elements=l.inverseBindMatrix;c.getInverse(b);k&&this.flipMatrixBone(c);-1<l.parentIndex&&(b.elements=a.joint[l.parentIndex].inverseBindMatrix,d.getInverse(b),k&&this.flipMatrixBone(d),d.getInverse(d),c.multiplyMatrices(d,c));e.setFromMatrixPosition(c);
|
||||
f.setFromRotationMatrix(c);g[n]={name:l.name,pos:[e.x,e.y,e.z],rotq:[f.x,f.y,f.z,f.w],parent:l.parentIndex}}return a.tag=g}}();THREE.SEA3D.prototype.getSkeletonAnimation=function(a,b){return this.isLegacy(a)?this.getSkeletonAnimationLegacy(a,b):this._getSkeletonAnimation(a,b)};
|
||||
THREE.SEA3D.prototype.getSkeletonAnimationLegacy=function(a,b){var c=new THREE.Matrix4,d=new THREE.Matrix4,e=new THREE.Matrix4,f=new THREE.Matrix4;return function(a,b){if(a.tag)return a.tag;for(var k=[],n=1E3/a.frameRate/1E3,l=[1,1,1],s=0;s<a.sequence.length;s++){for(var p=a.sequence[s],q=p.start,t=q+p.count,r={name:p.name,repeat:p.repeat,fps:a.frameRate,JIT:0,length:n*p.count,hierarchy:[]},m=a.numJoints,v=a.raw,w=0;w<m;w++){for(var y=b.joint[w],B={parent:y.parentIndex,keys:[]},C=B.keys,z=0,A=q;A<
|
||||
t;A++){var u=A*m*7+7*w;d.makeRotationFromQuaternion(THREE.SEA3D.QUABUF.set(v[u+3],v[u+4],v[u+5],v[u+6]));d.setPosition(THREE.SEA3D.VECBUF.set(v[u],v[u+1],v[u+2]));-1<y.parentIndex?(c.elements=b.joint[y.parentIndex].inverseBindMatrix,f.getInverse(c),e.multiplyMatrices(f,d),this.flipMatrixBone(e),this.flipMatrixBone(f),f.getInverse(f),d.multiplyMatrices(f,e)):this.flipMatrixBone(d);var u=THREE.SEA3D.VECBUF.setFromMatrixPosition(d),x=THREE.SEA3D.QUABUF.setFromRotationMatrix(d);C.push({time:z,pos:[u.x,
|
||||
u.y,u.z],rot:[x.x,x.y,x.z,x.w],scl:l});z+=n}r.hierarchy[w]=B}q=THREE.AnimationClip.parseAnimation(r,b.tag);q.loop=p.repeat;q.timeScale=1;k.push(q)}return a.tag=k}}();THREE.SEA3D.prototype.readVertexAnimation=function(a){if(this.isLegacy(a))for(var b=0,c=a.frame.length;b<c;b++){var d=a.frame[b];this.flipZVec3(d.vertex);this.flipZVec3(d.normal)}this._readVertexAnimation(a)};
|
||||
THREE.SEA3D.prototype.readGeometryBuffer=function(a){this.isLegacy(a)&&(this.flipZVec3(a.vertex),this.flipZVec3(a.normal),this.flipZIndex(a.indexes),4<a.jointPerVertex?this.compressJoints(a):4>a.jointPerVertex&&this.expandJoints(a));this._readGeometryBuffer(a)};THREE.SEA3D.prototype.readLines=function(a){this.isLegacy(a)&&this.flipZVec3(a.vertex);this._readLines(a)};THREE.SEA3D.prototype.onHead=function(a){};
|
||||
THREE.SEA3D.EXTENSIONS_LOADER.push({setTypeRead:function(){this.config.legacy=void 0==this.config.legacy?!0:this.config.legacy;this.file.typeRead[SEA3D.Skeleton.prototype.type]=this.readSkeleton}});
|
827
weboasis/arcade/3dcity/js/three.min.js
vendored
Normal file
418
weboasis/arcade/3dcity/js/worker.city.js
Normal file
@ -0,0 +1,418 @@
|
||||
'use strict';
|
||||
var transMessage = self.webkitPostMessage || self.postMessage;
|
||||
|
||||
var CITY = {};
|
||||
var timer;
|
||||
//var timestep = 1000/30;
|
||||
var Game;
|
||||
var pcount = 0;
|
||||
var power;
|
||||
|
||||
//var ab = new ArrayBuffer( 1 );
|
||||
//transMessage( ab, [ab] );
|
||||
var trans = false;// ( ab.byteLength === 0 );
|
||||
|
||||
self.onmessage = function (e) {
|
||||
var p = e.data.tell;
|
||||
if( p == "INIT" ) Game = new CITY.Game(e.data.url, e.data.timestep);
|
||||
if( p == "NEWMAP" ) Game.newMap();
|
||||
if( p == "PLAYMAP" ) Game.playMap();
|
||||
if( p == "TOOL" ) Game.tool(e.data.name);
|
||||
if( p == "MAPCLICK" ) Game.mapClick(e.data.x, e.data.y);
|
||||
|
||||
if( p == "DESTROY" ) Game.destroy(e.data.x, e.data.y);
|
||||
|
||||
//if( p == "RUN" && trans) updateTrans(e.data);
|
||||
|
||||
if( p == "DIFFICULTY" ) Game.changeDifficulty(e.data.n);
|
||||
if( p == "SPEED" ) Game.changeSpeed(e.data.n);
|
||||
|
||||
if( p == "BUDGET") Game.handleBudgetRequest();
|
||||
if( p == "NEWBUDGET") Game.setBudget(e.data.budgetData);
|
||||
|
||||
if( p == "DISASTER") Game.setDisaster(e.data.disaster);
|
||||
|
||||
if( p == "EVAL") Game.getEvaluation();
|
||||
|
||||
if( p == "SAVEGAME") Game.saveGame(e.data.saveCity);
|
||||
if( p == "LOADGAME") Game.loadGame(e.data.isStart);
|
||||
if( p == "MAKELOADGAME") Game.makeLoadGame(e.data.savegame, e.data.isStart);
|
||||
};
|
||||
|
||||
/*var updateTrans = function(data){
|
||||
if (!Game.isPaused){
|
||||
Game.simulation.needPower = [];
|
||||
Game.simulation.simFrame();
|
||||
Game.simulation.updateFrontEnd();
|
||||
|
||||
Game.processMessages(Game.simulation.messageManager.getMessages());
|
||||
Game.simulation.spriteManager.moveObjects();
|
||||
}
|
||||
//Game.getTiles();
|
||||
//Game.animatedTiles();
|
||||
Game.calculateSprites();
|
||||
//sprite = calculateSpritesForPaint();
|
||||
//gameCanvas.paint(mouse, sprite, isPaused);
|
||||
//transMessage({ tell:"RUN", infos:Game.infos, sprites:Game.map.genFull() });
|
||||
//transMessage({ tell:"RUN", infos:Game.infos, tiles:Game.tilesData, anims:Game.animsData, sprites:Game.spritesData});
|
||||
var tilesData = data.tilesData;
|
||||
var i = tilesData.length;
|
||||
while(i--){tilesData[i] = Game.map.tilesData[i];}
|
||||
|
||||
transMessage({ tell:"RUN", infos:Game.infos, tilesData:tilesData, anims:Game.animsData, sprites:Game.spritesData}, [tilesData.buffer]);
|
||||
};*/
|
||||
|
||||
var update = function(){
|
||||
power = null;
|
||||
if (!Game.isPaused){
|
||||
pcount++;
|
||||
//Game.simulation.needPower = [];
|
||||
Game.simulation.simFrame();
|
||||
Game.simulation.updateFrontEnd();
|
||||
|
||||
Game.processMessages(Game.simulation.messageManager.getMessages());
|
||||
Game.simulation.spriteManager.moveObjects();
|
||||
if(pcount==30){
|
||||
pcount = 0;
|
||||
power = Game.map.powerData;
|
||||
//power = Game.simulation.needPower;
|
||||
}
|
||||
}
|
||||
//Game.getTiles();
|
||||
//Game.animatedTiles();
|
||||
Game.calculateSprites();
|
||||
//sprite = calculateSpritesForPaint();
|
||||
//gameCanvas.paint(mouse, sprite, isPaused);
|
||||
//transMessage({ tell:"RUN", infos:Game.infos, sprites:Game.map.genFull() });
|
||||
//transMessage({ tell:"RUN", infos:Game.infos, tiles:Game.tilesData, anims:Game.animsData, sprites:Game.spritesData});
|
||||
//var tilesData = Game.map.tilesData;
|
||||
|
||||
transMessage({ tell:"RUN", infos:Game.infos, tilesData:Game.map.tilesData, powerData:power, sprites:Game.spritesData});
|
||||
//transMessage({ tell:"RUN", infos:Game.infos, tilesData:Game.map.data, powerData:power, sprites:Game.spritesData});
|
||||
};
|
||||
|
||||
CITY.Game = function(url, timestep) {
|
||||
importScripts(url);
|
||||
this.timestep = timestep;
|
||||
|
||||
this.mapSize = [128,128];
|
||||
this.difficulty = 0;
|
||||
this.speed = 2;
|
||||
this.oldSpeed = 0;
|
||||
this.mapGen = new Micro.generateMap();
|
||||
|
||||
this.simulation = null;
|
||||
this.gameTools = null;
|
||||
this.animationManager = null;
|
||||
this.map = null;
|
||||
|
||||
this.isPaused = false;
|
||||
this.simNeededBudget = false;
|
||||
this.currentTool = null;
|
||||
this.timer = null;
|
||||
this.infos = [];
|
||||
this.sprites = [];
|
||||
|
||||
this.spritesData = null;
|
||||
this.animsData = null;
|
||||
//this.tilesData = null;
|
||||
|
||||
this.spritesData = [];
|
||||
|
||||
//this.needMapUpdate = false;
|
||||
|
||||
|
||||
this.newMap();
|
||||
};
|
||||
|
||||
CITY.Game.prototype = {
|
||||
constructor: CITY.Game,
|
||||
newMap: function () {
|
||||
|
||||
this.map = this.mapGen.construct( this.mapSize[0], this.mapSize[1] );
|
||||
transMessage({ tell:"NEWMAP", tilesData:this.map.tilesData, mapSize:this.mapSize, island:this.map.isIsland, trans:trans });
|
||||
//transMessage({ tell:"NEWMAP", tilesData:this.map.data, mapSize:this.mapSize, island:this.map.isIsland, trans:trans });
|
||||
},
|
||||
playMap: function( loading ){
|
||||
var messageMgr = new Micro.MessageManager();
|
||||
var money = 20000;
|
||||
if(this.difficulty == 1) money = 10000;
|
||||
if(this.difficulty == 2) money = 5000;
|
||||
this.gameTools = new Micro.GameTools(this.map);
|
||||
this.animationManager = new Micro.AnimationManager(this.map);
|
||||
|
||||
if(loading){
|
||||
money = this.savedGame.totalFunds;
|
||||
//this.infos[3] = this.savedGame.totalPop;
|
||||
this.speed = this.savedGame.speed;
|
||||
this.difficulty = this.savedGame.difficulty;
|
||||
this.simulation = new Micro.Simulation( this.map, this.difficulty, this.speed, true, this.savedGame);
|
||||
//this.processMessages(Messages.EVAL_UPDATED);
|
||||
messageMgr.sendMessage(Messages.WELCOMEBACK);
|
||||
}else{
|
||||
this.simulation = new Micro.Simulation( this.map, this.difficulty, this.speed, true);
|
||||
messageMgr.sendMessage(Messages.WELCOME);
|
||||
}
|
||||
|
||||
this.simulation.budget.setFunds(money);
|
||||
messageMgr.sendMessage(Messages.FUNDS_CHANGED, money);
|
||||
this.processMessages(messageMgr.getMessages());
|
||||
|
||||
// update simulation time
|
||||
this.isPaused = false
|
||||
//if(!trans)
|
||||
this.timer = setInterval(update, 1000/this.timestep);
|
||||
//else update();
|
||||
},
|
||||
changeTimeStep :function(n){
|
||||
clearInterval(this.timer);
|
||||
this.timestep = n;
|
||||
this.timer = setInterval(update, 1000/this.timestep);
|
||||
},
|
||||
changeSpeed :function(n){
|
||||
// 0:pause 1:slow 2:medium 3:fast
|
||||
this.speed = n;
|
||||
if(this.speed === 0) this.isPaused = true;
|
||||
else this.isPaused = false;
|
||||
|
||||
if(this.speed === 4){
|
||||
this.changeTimeStep(60);
|
||||
this.simulation.setSpeed(this.speed-1);
|
||||
} else {
|
||||
if(this.timestep===60) this.changeTimeStep(30);
|
||||
this.simulation.setSpeed(this.speed);
|
||||
}
|
||||
},
|
||||
changeDifficulty:function(n){
|
||||
// 0: easy 1: medium 2: hard
|
||||
this.difficulty = n;
|
||||
if(this.simulation) this.simulation.setDifficulty ( this.difficulty );
|
||||
},
|
||||
animatedTiles : function() {
|
||||
var animTiles = this.animationManager.getTiles(0, 0, this.mapSize[0] + 1, this.mapSize[1] + 1, this.isPaused);
|
||||
var i = animTiles.length;
|
||||
this.animsData = new M_ARRAY_TYPE(i);
|
||||
while(i--){
|
||||
var tile = animTiles[i];
|
||||
this.animsData[i] = [tile.tileValue, tile.x, tile.y];
|
||||
}
|
||||
},
|
||||
calculateSprites : function() {
|
||||
this.sprites = this.simulation.spriteManager.getSpritesInView(0, 0, this.mapSize[0] + 1, this.mapSize[1] + 1);
|
||||
var i = this.sprites.length;
|
||||
//this.spritesData = new M_ARRAY_TYPE(i);
|
||||
while(i--){
|
||||
var sprite = this.sprites[i];
|
||||
this.spritesData[i] = [sprite.type, sprite.frame, sprite.x || 0, sprite.y || 0];
|
||||
}
|
||||
},
|
||||
processMessages : function(messages) {
|
||||
var messageOutput = false;
|
||||
|
||||
for (var i = 0, l = messages.length; i < l; i++) {
|
||||
var m = messages[i];
|
||||
switch (m.message) {
|
||||
case Messages.BUDGET_NEEDED: this.simNeededBudget = true; this.handleBudgetRequest(); break;
|
||||
case Messages.QUERY_WINDOW_NEEDED: transMessage({tell:"QUERY", queryTxt:this.currentTool.getInfo() }); break;
|
||||
case Messages.DATE_UPDATED: this.infos[0] = [TXT.months[ m.data.month ], m.data.year].join(' '); break;
|
||||
case Messages.EVAL_UPDATED: this.infos[1] = TXT.cityClass[m.data.classification]; this.infos[2] = m.data.score; this.infos[3] = m.data.population; break;
|
||||
case Messages.FUNDS_CHANGED: this.infos[4] = m.data; break;
|
||||
case Messages.VALVES_UPDATED: this.infos[5] = m.data.residential; this.infos[6] = m.data.commercial; this.infos[7] = m.data.industrial; break;
|
||||
default:
|
||||
if (!messageOutput && TXT.goodMessages[m.message] !== undefined) {
|
||||
this.infos[8] = TXT.goodMessages[m.message];
|
||||
break;
|
||||
}
|
||||
if (!messageOutput && TXT.badMessages[m.message] !== undefined) {
|
||||
messageOutput = true;
|
||||
this.infos[8] = TXT.badMessages[m.message];
|
||||
break;
|
||||
}
|
||||
if (!messageOutput && TXT.neutralMessages[m.message] !== undefined) {
|
||||
messageOutput = true;
|
||||
this.infos[8] = TXT.neutralMessages[m.message] ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
tool : function(name){
|
||||
if(this.currentTool!==null) this.currentTool.clear();
|
||||
if(name !== "none") this.currentTool = this.gameTools[name];
|
||||
else this.currentTool = null;
|
||||
},
|
||||
destroy : function(x,y){
|
||||
this.mapClick(x,y);
|
||||
this.map.powerData[this.findId(x,y)] = 1;
|
||||
// this.simulation.powerManager.setTilePower(x,y);
|
||||
// var messageMgr = new Micro.MessageManager();
|
||||
// this.gameTools["bulldozer"].doTool(x, y, messageMgr, this.simulation.blockMaps );
|
||||
},
|
||||
findId : function(x, y){
|
||||
var id = x+(y*this.mapSize[1]);
|
||||
return id;
|
||||
},
|
||||
mapClick : function(x,y){
|
||||
if(this.currentTool!==null){
|
||||
//console.log(this.currentTool[0])
|
||||
var budget = this.simulation.budget;
|
||||
var evaluation = this.simulation.evaluation;
|
||||
var messageMgr = new Micro.MessageManager();
|
||||
this.currentTool.doTool(x, y, messageMgr, this.simulation.blockMaps );
|
||||
this.currentTool.modifyIfEnoughFunding(budget, messageMgr);
|
||||
var tell = "";
|
||||
|
||||
switch (this.currentTool.result) {
|
||||
case this.currentTool.TOOLRESULT_NEEDS_BULLDOZE: tell = TXT.toolMessages.needsDoze; break;
|
||||
case this.currentTool.TOOLRESULT_NO_MONEY: tell = TXT.toolMessages.noMoney; break;
|
||||
default:
|
||||
tell = ' ';
|
||||
//if( id >= 11 && id != 15 ) this.needMapUpdate = true;
|
||||
transMessage({tell:"BUILD", x:x, y:y });
|
||||
break;
|
||||
}
|
||||
|
||||
this.processMessages(messageMgr.getMessages());
|
||||
}
|
||||
},
|
||||
setDisaster : function(disaster){
|
||||
if (disaster === Micro.DISASTER_NONE) return;
|
||||
var m = new Micro.MessageManager();
|
||||
switch (disaster) {
|
||||
case Micro.DISASTER_MONSTER: this.simulation.spriteManager.makeMonster(m); break;
|
||||
case Micro.DISASTER_FIRE: this.simulation.disasterManager.makeFire(m); break;
|
||||
case Micro.DISASTER_FLOOD: this.simulation.disasterManager.makeFlood(m); break;
|
||||
case Micro.DISASTER_CRASH: this.simulation.disasterManager.makeCrash(m); break;
|
||||
case Micro.DISASTER_MELTDOWN: this.simulation.disasterManager.makeMeltdown(m); break;
|
||||
case Micro.DISASTER_TORNADO: this.simulation.spriteManager.makeTornado(m); break;
|
||||
}
|
||||
this.processMessages(m.getMessages());
|
||||
},
|
||||
setBudget : function(budgetData){
|
||||
this.simulation.budget.cityTax = budgetData[0];
|
||||
this.simulation.budget.roadPercent = budgetData[1]/100;
|
||||
this.simulation.budget.firePercent = budgetData[2]/100;
|
||||
this.simulation.budget.policePercent = budgetData[3]/100;
|
||||
},
|
||||
handleBudgetRequest : function() {
|
||||
this.budgetShowing = true;
|
||||
|
||||
var budgetData = {
|
||||
roadFund: this.simulation.budget.roadFund,
|
||||
roadRate: Math.floor(this.simulation.budget.roadPercent * 100),
|
||||
fireFund: this.simulation.budget.fireFund,
|
||||
fireRate: Math.floor(this.simulation.budget.firePercent * 100),
|
||||
policeFund: this.simulation.budget.policeFund,
|
||||
policeRate: Math.floor(this.simulation.budget.policePercent * 100),
|
||||
taxRate: this.simulation.budget.cityTax,
|
||||
totalFunds: this.simulation.budget.totalFunds,
|
||||
taxesCollected: this.simulation.budget.taxFund
|
||||
};
|
||||
|
||||
transMessage({ tell:"BUDGET", budgetData:budgetData});
|
||||
|
||||
if (this.simNeededBudget) {
|
||||
this.simulation.budget.doBudget(this.simulation.messageManager);
|
||||
this.simNeededBudget = false;
|
||||
} else {
|
||||
this.simulation.budget.updateFundEffects();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//this.budgetWindow.open(this.handleBudgetClosed.bind(this), budgetData);
|
||||
// Let the input know we handled this request
|
||||
//this.inputStatus.budgetHandled();
|
||||
},
|
||||
|
||||
getEvaluation : function(){
|
||||
var evaluation = this.simulation.evaluation;
|
||||
var problemes = "";
|
||||
for (var i = 0; i < 4; i++) {
|
||||
var problemNo = evaluation.getProblemNumber(i);
|
||||
var text = '';
|
||||
if (problemNo !== -1) text =TXT.problems[problemNo];
|
||||
problemes += text+"<br>";
|
||||
}
|
||||
|
||||
var evalData = [ evaluation.cityYes, problemes];
|
||||
|
||||
transMessage({ tell:"EVAL", evalData:evalData});
|
||||
|
||||
},
|
||||
|
||||
|
||||
//______________________________________ SAVE
|
||||
|
||||
|
||||
saveGame : function(cityData){
|
||||
//this.oldSpeed = this.speed;
|
||||
//this.changeSpeed(0);
|
||||
|
||||
var gameData = {name:"Yoooooo", everClicked: true};
|
||||
gameData.speed = this.speed;
|
||||
gameData.difficulty = this.difficulty;
|
||||
gameData.version = Micro.CURRENT_VERSION;
|
||||
gameData.city = cityData;
|
||||
this.simulation.save(gameData);
|
||||
|
||||
gameData = JSON.stringify(gameData);
|
||||
|
||||
transMessage({ tell:"SAVEGAME", gameData:gameData, key:Micro.KEY });
|
||||
|
||||
//this.changeSpeed(this.oldSpeed);
|
||||
},
|
||||
/*makeSaveGame : function(gameData){
|
||||
gameData.version = Micro.CURRENT_VERSION;
|
||||
gameData = JSON.stringify(gameData);
|
||||
}*/
|
||||
|
||||
//______________________________________ LOAD
|
||||
|
||||
loadGame : function(atStart){
|
||||
var isStart = atStart || false;
|
||||
transMessage({ tell:"LOADGAME", key:Micro.KEY, isStart:isStart });
|
||||
},
|
||||
makeLoadGame: function(gameData, atStart){
|
||||
var isStart = atStart || false;
|
||||
clearInterval(this.timer);
|
||||
this.savedGame = JSON.parse(gameData);
|
||||
|
||||
//this.simulation.load(this.savedGame);
|
||||
//this.map = this.simulation.map;
|
||||
// this.everClicked = savedGame.everClicked;
|
||||
//if (savedGame.version !== Micro.CURRENT_VERSION) this.transitionOldSave(savedGame);
|
||||
//savedGame.isSavedGame = true;
|
||||
/*if(this.map){
|
||||
this.map.load(this.savedGame);
|
||||
}else{*/
|
||||
this.map = new Micro.GameMap(Micro.MAP_WIDTH, Micro.MAP_HEIGHT);
|
||||
this.map.load(this.savedGame);
|
||||
//}
|
||||
|
||||
//
|
||||
|
||||
this.playMap(true);
|
||||
//this.simulation.map = this.map;
|
||||
|
||||
//
|
||||
//this.map = this.simulation.map;
|
||||
|
||||
transMessage({ tell:"FULLREBUILD", tilesData:this.map.tilesData, mapSize:this.mapSize, island:this.map.isIsland, cityData:this.savedGame.city, isStart:isStart });
|
||||
},
|
||||
transitionOldSave : function (savedGame) {
|
||||
switch (savedGame.version) {
|
||||
case 1: savedGame.everClicked = false;
|
||||
/* falls through */
|
||||
case 2:
|
||||
savedGame.pollutionMaxX = Math.floor(savedGame.width / 2);
|
||||
savedGame.pollutionMaxY = Math.floor(savedGame.height / 2);
|
||||
savedGame.cityCentreX = Math.floor(savedGame.width / 2);
|
||||
savedGame.cityCentreY = Math.floor(savedGame.height / 2);
|
||||
break;
|
||||
//default: throw new Error('Unknown save version!');
|
||||
}
|
||||
}
|
||||
|
||||
};
|