背景
最近在追剧,看这个《天才基本法》,看到一段演员在敲代码的剧情,顿时列文虎克起来,就是下面这张:
心中本着“演员应该不能会javascript吧”的想法💡(不然也太NB了吧).
于是一顿索引,发现了这个截图中的开源项目源代码.果然不出所料!大概率是copy的,除非他就是作者本人!继续安心追剧😂(裴神被我发现了哦)
下面放出来项目源地址,大家有空可以把这个游戏搞出来玩玩!
项目地址
完整的项目见Github,这里只放出上面截图对应的Code:
active: function(event, source, skill, sec) {
var targets = JSON.parse(skill.data('targets'));
if (sec) targets = JSON.parse(skill.data('secondary targets'));
if (source.canCast(skill) ) {
if (skill.hasClass('channel-on'))
game.highlight.channelStop(event, skill, source);
else if (targets) {
if (targets.indexOf(game.data.ui.tree) >= 0)
game.highlight.tree(skill.side());
if (targets.indexOf(game.data.ui.self) >= 0)
game.highlight.self(source);
if (targets.indexOf(game.data.ui.ally) >= 0)
game.highlight.ally(source, skill);
if (targets.indexOf(game.data.ui.enemy) >= 0)
game.highlight.enemy(source, skill);
if (targets.indexOf(game.data.ui.jungle) >= 0)
game.highlight.jungle(source, skill);
if (targets.indexOf(game.data.ui.sumonner) >= 0)
game.highlight.summoner(source, skill);
if (targets.indexOf(game.data.ui.spot) >= 0) {
if (targets.indexOf(game.data.ui.range) >= 0)
game.highlight.atRange(source, skill, (targets.indexOf(game.data.ui.free) >= 0));
else if (targets.indexOf(game.data.ui.free) >= 0)
game.highlight.freeSpots(source, skill);
else {
var aoe = skill.data('aoe');
if (aoe === game.data.ui.radial)
game.highlight.radial(source, skill);
if (aoe === game.data.ui.linear)
game.highlight.linear(source, skill);
}
}
}
}
},