Mercurial > mamba
changeset 261:d0ed88799c44
mutation indicators
author | Adrianna Pińska <adrianna.pinska@gmail.com> |
---|---|
date | Thu, 15 Sep 2011 02:21:34 +0200 |
parents | e461aa9d112f |
children | 9f3b4e16372e |
files | data/tiles/common/snake/snake-tail-fire.png data/tiles/common/snake/snake-tail-puddle.png data/tiles/common/snake/snake-tail.png mamba/snake.py source/svg/tiles/common/snake/snake-tail-fire.svg source/svg/tiles/common/snake/snake-tail-puddle.svg source/svg/tiles/common/snake/snake-tail.svg |
diffstat | 7 files changed, 231 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mamba/snake.py Thu Sep 15 01:50:50 2011 +0200 +++ b/mamba/snake.py Thu Sep 15 02:21:34 2011 +0200 @@ -116,6 +116,7 @@ def mutate(self, mutation): self.mutation = mutation + self.tail.show_mutation(mutation) def can_swim(self): return self.mutation == 'amphibious' @@ -295,5 +296,15 @@ class Tail(Segment): + INDICATORS = { + "flame-retardant": mutators.Overlay("snake/snake-tail-fire"), + "amphibious": mutators.Overlay("snake/snake-tail-puddle"), + } + def __init__(self, tile_pos): super(Tail, self).__init__("snake-tail", tile_pos) + + def show_mutation(self, mutation): + self._detail_mutators = (self.INDICATORS[mutation],) + self.make_images() + self.update_image()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/source/svg/tiles/common/snake/snake-tail-fire.svg Thu Sep 15 02:21:34 2011 +0200 @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="200" + height="200" + id="svg2" + version="1.1" + inkscape:version="0.48.1 r9760" + sodipodi:docname="snake-tail.svg"> + <defs + id="defs4"> + <linearGradient + id="linearGradient3765"> + <stop + style="stop-color:#0000ff;stop-opacity:1;" + offset="0" + id="stop3781" /> + <stop + id="stop3783" + offset="0.5" + style="stop-color:#0000ff;stop-opacity:0;" /> + <stop + id="stop3769" + offset="1" + style="stop-color:#0000ff;stop-opacity:1;" /> + </linearGradient> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="2.915" + inkscape:cx="54.115687" + inkscape:cy="102.83799" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1172" + inkscape:window-height="752" + inkscape:window-x="108" + inkscape:window-y="0" + inkscape:window-maximized="1" + showguides="true" + inkscape:guide-bbox="true"> + <sodipodi:guide + orientation="1,0" + position="10,75.814751" + id="guide4028" /> + <sodipodi:guide + orientation="1,0" + position="190,85.763293" + id="guide4030" /> + <sodipodi:guide + orientation="0,1" + position="211.32075,100" + id="guide4032" /> + <sodipodi:guide + orientation="0,1" + position="10,50" + id="guide4034" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-852.36218)"> + <g + transform="matrix(0,-0.66857237,0.66857237,0,-567.54504,1019.3933)" + id="g3010"> + <path + style="fill:#ff7d00;fill-opacity:0.78431373;stroke:none" + d="m 64.144395,1042.977 c 82.679275,33.6585 152.635035,-52.85858 128.644935,-130.36027 -44.30439,3.2133 -36.94747,36.65736 -53.17323,33.96225 20.83749,-49.80629 -32.77254,-66.50669 -46.998289,-92.2813 -23.072295,25.30074 -38.1349,36.6836 -38.078901,69.63979 C 33.729078,927.3617 49.868675,902.34831 7.5406229,901.63902 -3.5515147,970.6794 1.9103453,1017.6416 64.144395,1042.977 z" + id="path3862" + inkscape:connector-curvature="0" + sodipodi:nodetypes="scccccs" /> + <path + sodipodi:nodetypes="scccccs" + inkscape:connector-curvature="0" + id="path3812" + d="m 109.79046,1031.6562 c -61.436259,4.806 -97.901181,-62.24996 -96.741001,-84.3911 35.924218,-14.3851 49.206608,26.86124 65.523157,24.35676 -27.012457,-36.08416 4.299124,-73.0247 18.524871,-98.79931 20.077793,26.38965 46.898423,47.40611 32.933103,85.42024 20.58129,2.96714 10.79168,-26.49893 56.94683,-19.55403 -7.32647,44.72892 -13.17011,87.95964 -77.18696,92.96744 z" + style="fill:#ff0000;fill-opacity:0.78431373;stroke:none" /> + </g> + </g> +</svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/source/svg/tiles/common/snake/snake-tail-puddle.svg Thu Sep 15 02:21:34 2011 +0200 @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="200" + height="200" + id="svg2" + version="1.1" + inkscape:version="0.48.1 r9760" + sodipodi:docname="snake-tail-fire.svg"> + <defs + id="defs4"> + <linearGradient + id="linearGradient3765"> + <stop + style="stop-color:#0000ff;stop-opacity:1;" + offset="0" + id="stop3781" /> + <stop + id="stop3783" + offset="0.5" + style="stop-color:#0000ff;stop-opacity:0;" /> + <stop + id="stop3769" + offset="1" + style="stop-color:#0000ff;stop-opacity:1;" /> + </linearGradient> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="2.915" + inkscape:cx="90.560629" + inkscape:cy="88.135555" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1172" + inkscape:window-height="752" + inkscape:window-x="108" + inkscape:window-y="0" + inkscape:window-maximized="1" + showguides="true" + inkscape:guide-bbox="true"> + <sodipodi:guide + orientation="1,0" + position="10,75.814751" + id="guide4028" /> + <sodipodi:guide + orientation="1,0" + position="190,85.763293" + id="guide4030" /> + <sodipodi:guide + orientation="0,1" + position="211.32075,100" + id="guide4032" /> + <sodipodi:guide + orientation="0,1" + position="10,50" + id="guide4034" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-852.36218)"> + <path + style="fill:#00ffff;stroke:none;stroke-width:1.35459638000000004px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:0.78431373999999998" + d="m 47.884854,915.99854 c -12.097801,30.44373 21.574492,81.49502 46.90326,86.36366 40.667446,7.817 86.410346,-90.7561 12.564936,-105.85837 -29.622116,-6.05808 -51.764502,0.10861 -59.468196,19.49471 z" + id="path3092" + inkscape:connector-curvature="0" + sodipodi:nodetypes="assa" /> + <path + style="fill:#00ffff;stroke:none;stroke-width:1.22000431999999992px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:0.78431373999999998" + d="m 10,994.47201 c 0.170027,3.6209 -3.984617,16.34999 16.314356,20.58319 23.206248,4.8395 35.711493,-10.323 25.245243,-28.07109 C 37.127808,962.51143 9.339749,980.41121 10,994.47201 z" + id="path3092-6" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ssss" /> + <path + style="fill:#00ffff;stroke:none;stroke-width:1.22000431999999992px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:0.78431373999999998" + d="m 10,919.33927 c -0.353794,3.34889 -1.791526,29.41444 16.314356,20.5832 13.001304,-6.34146 13.355941,-11.38263 9.464797,-20.86698 C 30.136049,905.30087 11.146587,908.48609 10,919.33927 z" + id="path3092-6-9" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ssss" /> + </g> +</svg>
--- a/source/svg/tiles/common/snake/snake-tail.svg Thu Sep 15 01:50:50 2011 +0200 +++ b/source/svg/tiles/common/snake/snake-tail.svg Thu Sep 15 02:21:34 2011 +0200 @@ -14,7 +14,7 @@ id="svg2" version="1.1" inkscape:version="0.48.1 r9760" - sodipodi:docname="snake-tail-r.svg"> + sodipodi:docname="snake-tail.svg"> <defs id="defs4"> <linearGradient @@ -42,7 +42,7 @@ inkscape:pageshadow="2" inkscape:zoom="2.915" inkscape:cx="93.223749" - inkscape:cy="113.72213" + inkscape:cy="61.970996" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" @@ -78,7 +78,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -96,6 +96,6 @@ sodipodi:rx="62.092625" sodipodi:ry="57.461407" d="m 164.32247,105.48885 a 62.092625,57.461407 0 1 1 -124.185252,0 62.092625,57.461407 0 1 1 124.185252,0 z" - transform="matrix(0.80524861,0,0,0.87014925,17.679561,860.57113)" /> + transform="matrix(0.80524861,0,0,0.87014925,57.679561,860.57113)" /> </g> </svg>