Skip to content

Instantly share code, notes, and snippets.

@xatest
xatest / coc_2.md
Created January 10, 2013 18:00
Clash of Clans攻略(二):进攻、奖杯与天梯~

#引言 防守可以单写一篇来介绍,所以本篇只谈进攻。进攻与奖杯,奖杯与天梯又密切关联,所以本篇将会一起介绍。

@xatest
xatest / coc_1.md
Last active December 10, 2015 22:39
Clash of Clans攻略(一):关键数值的意义~

#Clash of Clans攻略(一):关键数值的意义

##引言 前段时间对Clash of Clans做了一些游戏策划上的分析,我决定逐篇形成文字公开出来,给新手玩家做个指引,少走点弯路。我的本职工作与游戏策划无关,写此文时我的级别是30级,所以水平有限,多多指教。我不想写过于基础的攻略——有哪些资源,哪些建筑,哪些兵种——这种教程网上一搜一大把。

##关键数值 在游戏主界面上显示的5个数值,无疑是最重要的,分别是等级、奖杯、金币、水、宝石。下面说每个数值代表了什么样的宏观意义。

1. 等级(经验值)

等级代表了整体的建筑水平。经验值有4种输入(增加)途径,按增加的效率排序,1是建造/升级建筑,2是领取成就,3是给同部落盟友送兵,4是去掉地图上的石头/植物(一般叫除草)。其中第1种的增加效率远高于后3种,可以说经验值主要就是通过建造建筑贡献的,反过来经验值也就代表了整体的建筑水平。

Host bitbucket bitbucket.org
Hostname bitbucket.org
IdentityFile ~/.ssh/weedo_key
Host aws amazon.com
Hostname amazon.com
IdentityFile ~/.ssh/weedo.pem
Host github github.com
Hostname github.com
# Match Stick Man Game Network Protocol
# Defined in Thrift 0.9.0, for syntax: http://thrift.apache.org/
#Common
struct CommonResponse{
1: required i16 ret, # 0=OK
2: required string errmsg # ""=OK
}
struct Position{
#!/usr/local/bin/thrift --java --php --py
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@xatest
xatest / expire.php
Created November 7, 2012 13:16
计算过期时间
<?php
date_default_timezone_set('UTC');
$now = "2000-1-1 00:00:00";
$now = strtotime($now);
// 2678400 = 31 * 24 * 60 * 60
$expireDate = $now + 2678400;
echo "expire at " . date("Y-m-d H:i:s", $expireDate);
?>
@xatest
xatest / expire.php
Created November 7, 2012 12:48
计算过期时间
<?php
date_default_timezone_set('UTC');
$now = date("Y-m-d H:i:s");
$expireDate = mktime(date("H", $now), date("i", $now), date("s", $now), date("m", $now), date("d", $now)+31, date("Y", $now));
echo "expire at " . date("Y-m-d H:i:s", $expireDate);
?>
@xatest
xatest / Logger::err()
Created September 13, 2012 17:17
add function to Logger err()
public static function err($str)
{
if ( !strlen($str) ) {
return false;
}
if ( empty(self::$log) ) {
self::$log = new Logger(LOG_NAME);
}
@xatest
xatest / wundergroundAPISamples.php
Created September 7, 2012 14:07
wunderground php api code samples
<?php
$json_string = file_get_contents("http://api.wunderground.com/api/ff45980735b46389/geolookup/conditions/q/IA/Cedar_Rapids.json");
$parsed_json = json_decode($json_string);
$location = $parsed_json->{'location'}->{'city'};
$temp_f = $parsed_json->{'current_observation'}->{'temp_f'};
echo "Current temperature in ${location} is: ${temp_f}\n";
?>
@xatest
xatest / JSON to PHP Array
Created August 25, 2012 07:55
JSON to PHP Array
<?php
$testjson = '{"data":[{"articles":[{"content":"Hi, aaa","image":["http://www.weedo.hk/resouces/aaa_0.png","http://www.weedo.hk/resouces/aaa_1.png","http://www.weedo.hk/resouces/aaa_2.png"],"thumbnail":"http://www.weedo.hk/resouces/aaa_thumb.png","title":"aaa"},{"content":"Hi, bbb","image":["http://www.weedo.hk/resouces/bbb_0.png","http://www.weedo.hk/resouces/bbb_1.png","http://www.weedo.hk/resouces/bbb_2.png"],"thumbnail":"http://www.weedo.hk/resouces/bbb_thumb.png","title":"bbb"}],"image":"http://www.weedo.hk/resouces/xxxx.png","title":"xxxx","type":"features"},{"articles":[{"appName":"Cute Weather","appURL":"http://itunes.apple.com/cn/app/ke-ai-tian-qi/id524058480?mt=8","content":"Hi, aaa","icon":"http://www.weedo.hk/resouces/aaa_icon.png","image":["http://www.weedo.hk/resouces/aaa_0.png","http://www.weedo.hk/resouces/aaa_1.png","http://www.weedo.hk/resouces/aaa_2.png"],"thumbnail":"http://www.weedo.hk/resouces/aaa_thumb.png","title":"aaa"},{"appName":"Cute Weather","appURL":"http://itunes.apple.com/